File tree 3 files changed +13
-9
lines changed
src/tools/compiletest/src
3 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -468,7 +468,13 @@ impl<'test> TestCx<'test> {
468
468
469
469
if let Some ( revision) = self . revision {
470
470
let normalized_revision = normalize_revision ( revision) ;
471
- cmd. args ( & [ "--cfg" , & normalized_revision] ) ;
471
+ let cfg_arg = [ "--cfg" , & normalized_revision] ;
472
+ if self . props . compile_flags . windows ( 2 ) . any ( |args| args == cfg_arg) {
473
+ panic ! (
474
+ "warning: redundant cfg argument `{normalized_revision}` is already created by the revision"
475
+ ) ;
476
+ }
477
+ cmd. args ( cfg_arg) ;
472
478
}
473
479
474
480
if !self . props . no_auto_check_cfg {
Original file line number Diff line number Diff line change 2
2
//@ compile-flags: -Copt-level=3 -Cdebug-assertions=no -Zub-checks=yes
3
3
//@ error-pattern: unsafe precondition(s) violated: Layout::from_size_align_unchecked requires
4
4
//@ revisions: toolarge badalign
5
- //@[toolarge] compile-flags: --cfg toolarge
6
- //@[badalign] compile-flags: --cfg badalign
7
5
8
6
fn main ( ) {
9
7
unsafe {
Original file line number Diff line number Diff line change 5
5
//@ revisions: address cfi kcfi leak memory thread
6
6
//@compile-flags: -Ctarget-feature=-crt-static
7
7
//@[address]needs-sanitizer-address
8
- //@[address]compile-flags: -Zsanitizer=address --cfg address
8
+ //@[address]compile-flags: -Zsanitizer=address
9
9
//@[cfi]needs-sanitizer-cfi
10
- //@[cfi]compile-flags: -Zsanitizer=cfi --cfg cfi
10
+ //@[cfi]compile-flags: -Zsanitizer=cfi
11
11
//@[cfi]compile-flags: -Clto -Ccodegen-units=1
12
12
//@[kcfi]needs-llvm-components: x86
13
- //@[kcfi]compile-flags: -Zsanitizer=kcfi --cfg kcfi --target x86_64-unknown-none
13
+ //@[kcfi]compile-flags: -Zsanitizer=kcfi --target x86_64-unknown-none
14
14
//@[kcfi]compile-flags: -C panic=abort
15
15
//@[leak]needs-sanitizer-leak
16
- //@[leak]compile-flags: -Zsanitizer=leak --cfg leak
16
+ //@[leak]compile-flags: -Zsanitizer=leak
17
17
//@[memory]needs-sanitizer-memory
18
- //@[memory]compile-flags: -Zsanitizer=memory --cfg memory
18
+ //@[memory]compile-flags: -Zsanitizer=memory
19
19
//@[thread]needs-sanitizer-thread
20
- //@[thread]compile-flags: -Zsanitizer=thread --cfg thread
20
+ //@[thread]compile-flags: -Zsanitizer=thread
21
21
22
22
#![ feature( cfg_sanitize, no_core, lang_items) ]
23
23
#![ crate_type="lib" ]
You can’t perform that action at this time.
0 commit comments