Skip to content

Commit b973cb7

Browse files
committed
compiletest: let config flags overwrite -A unused
1 parent 93dc97a commit b973cb7

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/tools/compiletest/src/runtest.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -1958,6 +1958,12 @@ impl<'test> TestCx<'test> {
19581958
None => {}
19591959
}
19601960

1961+
// Add `-A unused` before `config` flags and in-test (`props`) flags, so that they can
1962+
// overwrite this.
1963+
if let AllowUnused::Yes = allow_unused {
1964+
rustc.args(&["-A", "unused"]);
1965+
}
1966+
19611967
if self.props.force_host {
19621968
self.maybe_add_external_args(
19631969
&mut rustc,
@@ -1980,10 +1986,6 @@ impl<'test> TestCx<'test> {
19801986
rustc.arg("-Ctarget-feature=-crt-static");
19811987
}
19821988

1983-
if let AllowUnused::Yes = allow_unused {
1984-
rustc.args(&["-A", "unused"]);
1985-
}
1986-
19871989
rustc.args(&self.props.compile_flags);
19881990

19891991
rustc

0 commit comments

Comments
 (0)