Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
9d664b2
Make the pre-commit script pre-push instead
jyn514 Aug 25, 2021
9648b31
Impl {Add,Sub,Mul,Div,Rem,BitXor,BitOr,BitAnd}Assign<$t> for Wrapping…
kellerkindt Jan 22, 2022
9b8e4c6
Don't allow {} to refer to implicit captures in format_args.
m-ou-se Jan 27, 2022
fb2d530
Add test for format args capture bug.
m-ou-se Jan 27, 2022
cef9b47
Extend format-args capture test.
m-ou-se Jan 27, 2022
6562069
remove allow_fail test flag
Jan 28, 2022
0b8c9fb
add allow_fail field in TestDesc to pass check
Jan 28, 2022
4738ce4
Suggest 1-tuple parentheses, without existing parens
bobrippling Dec 4, 2021
c734c32
Replace span suggestion with multipart
bobrippling Dec 4, 2021
18cea90
Handle existing parentheses when suggesting trailing-tuple-comma
bobrippling Jan 28, 2022
91a43f0
Only suggest 1-tuple if expected and found types match
bobrippling Jan 28, 2022
72d3b45
Test 1-tuple parentheses wrapping
bobrippling Jan 28, 2022
0fb2b7a
Drop json::from_reader
Mark-Simulacrum Feb 5, 2022
2f23624
Drop time dependency from bootstrap
Mark-Simulacrum Feb 6, 2022
a4112dc
fix linking stage1 toolchain in setup
yerke Feb 6, 2022
e27ebb5
Linkify sidebar headings for sibling items
jsha Feb 4, 2022
57b102f
Fix tracking issue for `const_fn_trait_bound`
PatchMixolydic Feb 5, 2022
afb7a50
rewrite from_bytes_with_nul to match code style in from_vec_with_nul
inteon Feb 6, 2022
344ea6e
Factor out emit_tuple_wrap_err, improve Applicability
bobrippling Feb 2, 2022
82a0122
Merge duplicate suggestion string
bobrippling Feb 2, 2022
1870db6
Use shallow clones for submodules managed by rustbuild, not just boot…
jyn514 Feb 7, 2022
b5b2150
Rerun bootstrap's build script when RUSTC changes
jyn514 Feb 7, 2022
14ff58c
Stabilize wrapping_int_assign_impl in 1.60.0.
m-ou-se Feb 7, 2022
c2d6ddd
Rollup merge of #88313 - jyn514:pre-push, r=Mark-Simulacrum
m-ou-se Feb 7, 2022
fadf0fd
Rollup merge of #91530 - bobrippling:suggest-1-tuple-parens, r=camelid
m-ou-se Feb 7, 2022
74bde99
Rollup merge of #92724 - inteon:cleanup, r=Mark-Simulacrum
m-ou-se Feb 7, 2022
8b03594
Rollup merge of #93208 - kellerkindt:wrapping_int_assign_impl, r=m-ou-se
m-ou-se Feb 7, 2022
ad3309d
Rollup merge of #93394 - m-ou-se:fix-93378, r=estebank
m-ou-se Feb 7, 2022
6a7a60a
Rollup merge of #93416 - name1e5s:chore/remove_allow_fail, r=m-ou-se
m-ou-se Feb 7, 2022
6b066f0
Rollup merge of #93487 - yerke:yerke/fix-link-toolchain-in-setup, r=M…
m-ou-se Feb 7, 2022
3ad5779
Rollup merge of #93673 - jsha:linkify-sidebar-headings, r=GuillaumeGomez
m-ou-se Feb 7, 2022
0e53f19
Rollup merge of #93680 - Mark-Simulacrum:drop-json-reader, r=bjorn3
m-ou-se Feb 7, 2022
32df274
Rollup merge of #93682 - PatchMixolydic:where-in-the-world-is-const_f…
m-ou-se Feb 7, 2022
4ba3120
Rollup merge of #93685 - Mark-Simulacrum:drop-time, r=pietroalbini
m-ou-se Feb 7, 2022
ad539e0
Rollup merge of #93722 - jyn514:less-submodule-cloning, r=Mark-Simula…
m-ou-se Feb 7, 2022
14ffdd2
Rollup merge of #93723 - jyn514:rerun-if-changed, r=Mark-Simulacrum
m-ou-se Feb 7, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions compiler/rustc_builtin_macros/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,6 @@ pub fn expand_test_or_bench(
"ignore",
cx.expr_bool(sp, should_ignore(&cx.sess, &item)),
),
// allow_fail: true | false
field(
"allow_fail",
cx.expr_bool(sp, should_fail(&cx.sess, &item)),
),
// compile_fail: true | false
field("compile_fail", cx.expr_bool(sp, false)),
// no_run: true | false
Expand Down Expand Up @@ -359,10 +354,6 @@ fn should_ignore(sess: &Session, i: &ast::Item) -> bool {
sess.contains_name(&i.attrs, sym::ignore)
}

fn should_fail(sess: &Session, i: &ast::Item) -> bool {
sess.contains_name(&i.attrs, sym::allow_fail)
}

fn should_panic(cx: &ExtCtxt<'_>, i: &ast::Item) -> ShouldPanic {
match cx.sess.find_by_name(&i.attrs, sym::should_panic) {
Some(attr) => {
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_feature/src/active.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,6 @@ declare_features! (
(incomplete, adt_const_params, "1.56.0", Some(44580), None),
/// Allows defining an `#[alloc_error_handler]`.
(active, alloc_error_handler, "1.29.0", Some(51540), None),
/// Allows a test to fail without failing the whole suite.
(active, allow_fail, "1.19.0", Some(46488), None),
/// Allows explicit discriminants on non-unit enum variants.
(active, arbitrary_enum_discriminant, "1.37.0", Some(60553), None),
/// Allows trait methods with arbitrary self types.
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_feature/src/builtin_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,6 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
},

// Testing:
gated!(allow_fail, Normal, template!(Word), WarnFollowing, experimental!(allow_fail)),
gated!(
test_runner, CrateLevel, template!(List: "path"), ErrorFollowing, custom_test_frameworks,
"custom test frameworks are an unstable feature",
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_feature/src/removed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ declare_features! (
(removed, advanced_slice_patterns, "1.0.0", Some(62254), None,
Some("merged into `#![feature(slice_patterns)]`")),
(removed, allocator, "1.0.0", None, None, None),
/// Allows a test to fail without failing the whole suite.
(removed, allow_fail, "1.19.0", Some(46488), None, Some("removed due to no clear use cases")),
(removed, await_macro, "1.38.0", Some(50547), None,
Some("subsumed by `.await` syntax")),
/// Allows comparing raw pointers during const eval.
Expand Down
6 changes: 1 addition & 5 deletions library/test/src/console.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ pub struct ConsoleTestState {
pub passed: usize,
pub failed: usize,
pub ignored: usize,
pub allowed_fail: usize,
pub filtered_out: usize,
pub measured: usize,
pub exec_time: Option<TestSuiteExecTime>,
Expand All @@ -71,7 +70,6 @@ impl ConsoleTestState {
passed: 0,
failed: 0,
ignored: 0,
allowed_fail: 0,
filtered_out: 0,
measured: 0,
exec_time: None,
Expand Down Expand Up @@ -112,7 +110,6 @@ impl ConsoleTestState {
TestResult::TrFailed => "failed".to_owned(),
TestResult::TrFailedMsg(ref msg) => format!("failed: {}", msg),
TestResult::TrIgnored => "ignored".to_owned(),
TestResult::TrAllowedFail => "failed (allowed)".to_owned(),
TestResult::TrBench(ref bs) => fmt_bench_samples(bs),
TestResult::TrTimedFail => "failed (time limit exceeded)".to_owned(),
},
Expand All @@ -126,7 +123,7 @@ impl ConsoleTestState {
}

fn current_test_count(&self) -> usize {
self.passed + self.failed + self.ignored + self.measured + self.allowed_fail
self.passed + self.failed + self.ignored + self.measured
}
}

Expand Down Expand Up @@ -191,7 +188,6 @@ fn handle_test_result(st: &mut ConsoleTestState, completed_test: CompletedTest)
st.not_failures.push((test, stdout));
}
TestResult::TrIgnored => st.ignored += 1,
TestResult::TrAllowedFail => st.allowed_fail += 1,
TestResult::TrBench(bs) => {
st.metrics.insert_metric(
test.name.as_slice(),
Expand Down
13 changes: 1 addition & 12 deletions library/test/src/formatters/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,6 @@ impl<T: Write> OutputFormatter for JsonFormatter<T> {
self.write_event("test", desc.name.as_slice(), "ignored", exec_time, stdout, None)
}

TestResult::TrAllowedFail => self.write_event(
"test",
desc.name.as_slice(),
"allowed_failure",
exec_time,
stdout,
None,
),

TestResult::TrBench(ref bs) => {
let median = bs.ns_iter_summ.median as usize;
let deviation = (bs.ns_iter_summ.max - bs.ns_iter_summ.min) as usize;
Expand Down Expand Up @@ -172,14 +163,12 @@ impl<T: Write> OutputFormatter for JsonFormatter<T> {
\"event\": \"{}\", \
\"passed\": {}, \
\"failed\": {}, \
\"allowed_fail\": {}, \
\"ignored\": {}, \
\"measured\": {}, \
\"filtered_out\": {}",
if state.failed == 0 { "ok" } else { "failed" },
state.passed,
state.failed + state.allowed_fail,
state.allowed_fail,
state.failed,
state.ignored,
state.measured,
state.filtered_out,
Expand Down
2 changes: 1 addition & 1 deletion library/test/src/formatters/junit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ impl<T: Write> OutputFormatter for JunitFormatter<T> {
))?;
}

TestResult::TrOk | TestResult::TrAllowedFail => {
TestResult::TrOk => {
self.write_message(&*format!(
"<testcase classname=\"{}\" \
name=\"{}\" time=\"{}\"/>",
Expand Down
25 changes: 4 additions & 21 deletions library/test/src/formatters/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ impl<T: Write> PrettyFormatter<T> {
self.write_short_result("ignored", term::color::YELLOW)
}

pub fn write_allowed_fail(&mut self) -> io::Result<()> {
self.write_short_result("FAILED (allowed)", term::color::YELLOW)
}

pub fn write_time_failed(&mut self) -> io::Result<()> {
self.write_short_result("FAILED (time limit exceeded)", term::color::RED)
}
Expand Down Expand Up @@ -219,7 +215,6 @@ impl<T: Write> OutputFormatter for PrettyFormatter<T> {
TestResult::TrOk => self.write_ok()?,
TestResult::TrFailed | TestResult::TrFailedMsg(_) => self.write_failed()?,
TestResult::TrIgnored => self.write_ignored()?,
TestResult::TrAllowedFail => self.write_allowed_fail()?,
TestResult::TrBench(ref bs) => {
self.write_bench()?;
self.write_plain(&format!(": {}", fmt_bench_samples(bs)))?;
Expand Down Expand Up @@ -263,22 +258,10 @@ impl<T: Write> OutputFormatter for PrettyFormatter<T> {
self.write_pretty("FAILED", term::color::RED)?;
}

let s = if state.allowed_fail > 0 {
format!(
". {} passed; {} failed ({} allowed); {} ignored; {} measured; {} filtered out",
state.passed,
state.failed + state.allowed_fail,
state.allowed_fail,
state.ignored,
state.measured,
state.filtered_out
)
} else {
format!(
". {} passed; {} failed; {} ignored; {} measured; {} filtered out",
state.passed, state.failed, state.ignored, state.measured, state.filtered_out
)
};
let s = format!(
". {} passed; {} failed; {} ignored; {} measured; {} filtered out",
state.passed, state.failed, state.ignored, state.measured, state.filtered_out
);

self.write_plain(&s)?;

Expand Down
25 changes: 4 additions & 21 deletions library/test/src/formatters/terse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ impl<T: Write> TerseFormatter<T> {
self.write_short_result("i", term::color::YELLOW)
}

pub fn write_allowed_fail(&mut self) -> io::Result<()> {
self.write_short_result("a", term::color::YELLOW)
}

pub fn write_bench(&mut self) -> io::Result<()> {
self.write_pretty("bench", term::color::CYAN)
}
Expand Down Expand Up @@ -207,7 +203,6 @@ impl<T: Write> OutputFormatter for TerseFormatter<T> {
self.write_failed()
}
TestResult::TrIgnored => self.write_ignored(),
TestResult::TrAllowedFail => self.write_allowed_fail(),
TestResult::TrBench(ref bs) => {
if self.is_multithreaded {
self.write_test_name(desc)?;
Expand Down Expand Up @@ -244,22 +239,10 @@ impl<T: Write> OutputFormatter for TerseFormatter<T> {
self.write_pretty("FAILED", term::color::RED)?;
}

let s = if state.allowed_fail > 0 {
format!(
". {} passed; {} failed ({} allowed); {} ignored; {} measured; {} filtered out",
state.passed,
state.failed + state.allowed_fail,
state.allowed_fail,
state.ignored,
state.measured,
state.filtered_out
)
} else {
format!(
". {} passed; {} failed; {} ignored; {} measured; {} filtered out",
state.passed, state.failed, state.ignored, state.measured, state.filtered_out
)
};
let s = format!(
". {} passed; {} failed; {} ignored; {} measured; {} filtered out",
state.passed, state.failed, state.ignored, state.measured, state.filtered_out
);

self.write_plain(&s)?;

Expand Down
13 changes: 4 additions & 9 deletions library/test/src/test_result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ pub enum TestResult {
TrFailed,
TrFailedMsg(String),
TrIgnored,
TrAllowedFail,
TrBench(BenchSamples),
TrTimedFail,
}
Expand All @@ -42,8 +41,6 @@ pub fn calc_result<'a>(

if maybe_panic_str.map(|e| e.contains(msg)).unwrap_or(false) {
TestResult::TrOk
} else if desc.allow_fail {
TestResult::TrAllowedFail
} else if let Some(panic_str) = maybe_panic_str {
TestResult::TrFailedMsg(format!(
r#"panic did not contain expected string
Expand All @@ -64,7 +61,6 @@ pub fn calc_result<'a>(
(&ShouldPanic::Yes, Ok(())) | (&ShouldPanic::YesWithMessage(_), Ok(())) => {
TestResult::TrFailedMsg("test did not panic as expected".to_string())
}
_ if desc.allow_fail => TestResult::TrAllowedFail,
_ => TestResult::TrFailed,
};

Expand All @@ -90,11 +86,10 @@ pub fn get_result_from_exit_code(
time_opts: &Option<time::TestTimeOptions>,
exec_time: &Option<time::TestExecTime>,
) -> TestResult {
let result = match (desc.allow_fail, code) {
(_, TR_OK) => TestResult::TrOk,
(true, TR_FAILED) => TestResult::TrAllowedFail,
(false, TR_FAILED) => TestResult::TrFailed,
(_, _) => TestResult::TrFailedMsg(format!("got unexpected return code {}", code)),
let result = match code {
TR_OK => TestResult::TrOk,
TR_FAILED => TestResult::TrFailed,
_ => TestResult::TrFailedMsg(format!("got unexpected return code {}", code)),
};

// If test is already failed (or allowed to fail), do not change the result.
Expand Down
Loading