Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
37ce212
make exp_m1 examples more representative of use
tspiteri Sep 23, 2020
50d3ddc
make ln_1p examples more representative of use
tspiteri Sep 23, 2020
01b0aff
Add std::panic::panic_box.
m-ou-se Jul 22, 2020
16201da
Rename panic_box to panic_any.
m-ou-se Oct 18, 2020
9e16213
Suggest calling associated `fn` inside `trait`s
estebank Oct 26, 2020
a9d334d
Update panic_any feature name.
m-ou-se Oct 28, 2020
b48fee0
Add tracking issue number for panic_any.
m-ou-se Oct 28, 2020
4ba57aa
Strip tokens from trait and impl items before printing AST JSON
Aaron1011 Oct 29, 2020
dcbf2f3
rustc_llvm: unwrap LLVMMetadataRef before casting
cuviper Oct 29, 2020
93ca9ae
Qualify `panic!` as `core::panic!` in non-built-in `core` macros
camelid Oct 25, 2020
5c87941
Clean up `core` macros documentation
camelid Oct 25, 2020
7b3d897
Add two more test cases
camelid Oct 29, 2020
8cf7d66
Create config.toml in the current directory, not the top-level directory
jyn514 Oct 30, 2020
59c6ae6
Use SOCK_CLOEXEC and accept4() on more platforms.
de-vri-es Oct 30, 2020
922ebf4
Remove unused `use std::panic;`s
camelid Oct 30, 2020
23018a5
Implement rustc side of report-future-incompat
Aaron1011 Aug 13, 2020
6bdb4e3
Some work
Aaron1011 Oct 18, 2020
a77a65c
Print future breakage report
Aaron1011 Oct 19, 2020
2d17597
Strip out non-diagnostic lines from rustfix input
Aaron1011 Oct 19, 2020
4b4f84f
Only error on unfixed diagnostics
Aaron1011 Oct 19, 2020
4621ce9
Update into-iter-on-arrays test to check future-incompat-report
Aaron1011 Oct 19, 2020
2f6e59d
Don't display empty future-compat report
Aaron1011 Oct 19, 2020
7b7c223
Always pass `-Z future-incompat-report` to UI tests
Aaron1011 Oct 19, 2020
ac12e6f
Fix test
Aaron1011 Oct 20, 2020
6db00a2
Update Clippy path to `Lint`
Aaron1011 Oct 31, 2020
0541f8e
Rollup merge of #74622 - fusion-engineering-forks:panic-box, r=KodrAus
Dylan-DPC Oct 31, 2020
185b7fd
Rollup merge of #75534 - Aaron1011:feature/new-future-breakage, r=pnk…
Dylan-DPC Oct 31, 2020
fcffbcf
Rollup merge of #77099 - tspiteri:exp_m1-examples, r=m-ou-se
Dylan-DPC Oct 31, 2020
3eba549
Rollup merge of #78343 - camelid:macros-qualify-panic, r=m-ou-se
Dylan-DPC Oct 31, 2020
c5272d6
Rollup merge of #78420 - estebank:suggest-assoc-fn, r=petrochenkov
Dylan-DPC Oct 31, 2020
bd515ee
Rollup merge of #78526 - Aaron1011:fix/assoc-tokens, r=estebank
Dylan-DPC Oct 31, 2020
ebcf144
Rollup merge of #78531 - cuviper:unwrap-metadata, r=tmandry
Dylan-DPC Oct 31, 2020
61eb1a8
Rollup merge of #78550 - jyn514:setup, r=Mark-Simulacrum
Dylan-DPC Oct 31, 2020
defae8d
Rollup merge of #78572 - de-vri-es:bsd-cloexec, r=m-ou-se
Dylan-DPC Oct 31, 2020
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
Prev Previous commit
Next Next commit
Strip out non-diagnostic lines from rustfix input
  • Loading branch information
Aaron1011 committed Oct 31, 2020
commit 2d17597f849fce55aa730edaa8f1bf0e91d64147
22 changes: 17 additions & 5 deletions src/tools/compiletest/src/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ struct DiagnosticCode {
explanation: Option<String>,
}

pub fn rustfix_diagnostics_only(output: &str) -> String {
output.lines().filter(|line| {
line.starts_with('{') && serde_json::from_str::<Diagnostic>(line).is_ok()
}).collect()
}

pub fn extract_rendered(output: &str) -> String {
output
.lines()
Expand Down Expand Up @@ -126,11 +132,17 @@ fn parse_line(file_name: &str, line: &str, output: &str, proc_res: &ProcRes) ->
expected_errors
}
Err(error) => {
proc_res.fatal(Some(&format!(
"failed to decode compiler output as json: \
`{}`\nline: {}\noutput: {}",
error, line, output
)));
// Ignore the future compat report message - this is handled
// by `extract_rendered`
if serde_json::from_str::<FutureIncompatReport>(line).is_ok() {
vec![]
} else {
proc_res.fatal(Some(&format!(
"failed to decode compiler output as json: \
`{}`\nline: {}\noutput: {}",
error, line, output
)));
}
}
}
} else {
Expand Down
5 changes: 3 additions & 2 deletions src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2978,6 +2978,7 @@ impl<'test> TestCx<'test> {
self.prune_duplicate_outputs(&modes_to_prune);

let mut errors = self.load_compare_outputs(&proc_res, TestOutput::Compile, explicit);
let rustfix_input = json::rustfix_diagnostics_only(&proc_res.stderr);

if self.config.compare_mode.is_some() {
// don't test rustfix with nll right now
Expand All @@ -2988,7 +2989,7 @@ impl<'test> TestCx<'test> {
// This will return an empty `Vec` in case the executed test file has a
// `compile-flags: --error-format=xxxx` header with a value other than `json`.
let suggestions = get_suggestions_from_json(
&proc_res.stderr,
&rustfix_input,
&HashSet::new(),
Filter::MachineApplicableOnly,
)
Expand All @@ -3015,7 +3016,7 @@ impl<'test> TestCx<'test> {
// Apply suggestions from rustc to the code itself
let unfixed_code = self.load_expected_output_from_path(&self.testpaths.file).unwrap();
let suggestions = get_suggestions_from_json(
&proc_res.stderr,
&rustfix_input,
&HashSet::new(),
if self.props.rustfix_only_machine_applicable {
Filter::MachineApplicableOnly
Expand Down