1
Fork 0

Rollup merge of #70978 - RalfJung:compiletest-flags, r=Mark-Simulacrum

compiletest: let config flags overwrite -A unused

Cc https://github.com/laumann/compiletest-rs/issues/216
This commit is contained in:
Mazdak Farrokhzad 2020-04-10 18:15:21 +02:00 committed by GitHub
commit a5e06f28c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1958,6 +1958,12 @@ impl<'test> TestCx<'test> {
None => {} None => {}
} }
// Add `-A unused` before `config` flags and in-test (`props`) flags, so that they can
// overwrite this.
if let AllowUnused::Yes = allow_unused {
rustc.args(&["-A", "unused"]);
}
if self.props.force_host { if self.props.force_host {
self.maybe_add_external_args( self.maybe_add_external_args(
&mut rustc, &mut rustc,
@ -1980,10 +1986,6 @@ impl<'test> TestCx<'test> {
rustc.arg("-Ctarget-feature=-crt-static"); rustc.arg("-Ctarget-feature=-crt-static");
} }
if let AllowUnused::Yes = allow_unused {
rustc.args(&["-A", "unused"]);
}
rustc.args(&self.props.compile_flags); rustc.args(&self.props.compile_flags);
rustc rustc