let mut aux_rustc =
aux_cx.make_compile_args(input_file, aux_output, EmitMetadata::No, AllowUnused::No);
+ for key in &aux_props.unset_rustc_env {
+ aux_rustc.env_remove(key);
+ }
+ aux_rustc.envs(aux_props.rustc_env.clone());
+
let (dylib, crate_type) = if aux_props.no_prefer_dynamic {
(true, None)
} else if self.config.target.contains("cloudabi")
}
rustc.arg("-Zui-testing");
rustc.arg("-Zdeduplicate-diagnostics=no");
+ rustc.arg("-Zemit-future-incompat-report");
}
MirOpt => {
rustc.args(&[
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
// 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,
)
// 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
self.fatal_proc_rec("failed to compile fixed code", &res);
}
if !res.stderr.is_empty() && !self.props.rustfix_only_machine_applicable {
- self.fatal_proc_rec("fixed code is still producing diagnostics", &res);
+ if !json::rustfix_diagnostics_only(&res.stderr).is_empty() {
+ self.fatal_proc_rec("fixed code is still producing diagnostics", &res);
+ }
}
}
}