@@ -31,9 +31,9 @@ use rustc_middle::{
31
31
query:: { ExternProviders , LocalCrate } ,
32
32
ty:: TyCtxt ,
33
33
} ;
34
- use rustc_session:: { EarlyErrorHandler , CtfeBacktrace } ;
35
- use rustc_session:: config:: { OptLevel , CrateType , ErrorOutputType } ;
34
+ use rustc_session:: config:: { CrateType , ErrorOutputType , OptLevel } ;
36
35
use rustc_session:: search_paths:: PathKind ;
36
+ use rustc_session:: { CtfeBacktrace , EarlyErrorHandler } ;
37
37
38
38
use miri:: { BacktraceStyle , BorrowTrackerMethod , ProvenanceMode , RetagFields } ;
39
39
@@ -343,6 +343,8 @@ fn main() {
343
343
miri_config. borrow_tracker = None ;
344
344
} else if arg == "-Zmiri-tree-borrows" {
345
345
miri_config. borrow_tracker = Some ( BorrowTrackerMethod :: TreeBorrows ) ;
346
+ } else if arg == "-Zmiri-unique-is-unique" {
347
+ miri_config. unique_is_unique = true ;
346
348
} else if arg == "-Zmiri-disable-data-race-detector" {
347
349
miri_config. data_race_detector = false ;
348
350
miri_config. weak_memory_emulation = false ;
@@ -560,6 +562,14 @@ fn main() {
560
562
rustc_args. push ( arg) ;
561
563
}
562
564
}
565
+ // `-Zmiri-unique-is-unique` should only be used with `-Zmiri-tree-borrows`
566
+ if miri_config. unique_is_unique
567
+ && !matches ! ( miri_config. borrow_tracker, Some ( BorrowTrackerMethod :: TreeBorrows ) )
568
+ {
569
+ show_error ! (
570
+ "-Zmiri-unique-is-unique only has an effect when -Zmiri-tree-borrows is also used"
571
+ ) ;
572
+ }
563
573
564
574
debug ! ( "rustc arguments: {:?}" , rustc_args) ;
565
575
debug ! ( "crate arguments: {:?}" , miri_config. args) ;
0 commit comments