Skip to content

Commit cd3a7bb

Browse files
committed
ensure //@compile-flags are last even when passing --edition
1 parent cd371b9 commit cd3a7bb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: src/tools/compiletest/src/header.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,9 @@ impl TestProps {
385385
}
386386

387387
if let Some(edition) = config.parse_edition(ln) {
388-
self.compile_flags.push(format!("--edition={}", edition.trim()));
388+
// The edition is added at the start, since flags from //@compile-flags must
389+
// be passed to rustc last.
390+
self.compile_flags.insert(0, format!("--edition={}", edition.trim()));
389391
has_edition = true;
390392
}
391393

@@ -606,7 +608,9 @@ impl TestProps {
606608
}
607609

608610
if let (Some(edition), false) = (&config.edition, has_edition) {
609-
self.compile_flags.push(format!("--edition={}", edition));
611+
// The edition is added at the start, since flags from //@compile-flags must be passed
612+
// to rustc last.
613+
self.compile_flags.insert(0, format!("--edition={}", edition));
610614
}
611615
}
612616

0 commit comments

Comments
 (0)