@@ -514,8 +514,6 @@ fn main() {
514
514
515
515
let mut rustc_args = vec ! [ ] ;
516
516
let mut after_dashdash = false ;
517
- // If user has explicitly enabled/disabled isolation
518
- let mut isolation_enabled: Option < bool > = None ;
519
517
520
518
// Note that we require values to be given with `=`, not with a space.
521
519
// This matches how rustc parses `-Z`.
@@ -539,6 +537,7 @@ fn main() {
539
537
miri_config. borrow_tracker = None ;
540
538
} else if arg == "-Zmiri-tree-borrows" {
541
539
miri_config. borrow_tracker = Some ( BorrowTrackerMethod :: TreeBorrows ) ;
540
+ miri_config. provenance_mode = ProvenanceMode :: Strict ;
542
541
} else if arg == "-Zmiri-unique-is-unique" {
543
542
miri_config. unique_is_unique = true ;
544
543
} else if arg == "-Zmiri-disable-data-race-detector" {
@@ -548,19 +547,7 @@ fn main() {
548
547
miri_config. check_alignment = miri:: AlignmentCheck :: None ;
549
548
} else if arg == "-Zmiri-symbolic-alignment-check" {
550
549
miri_config. check_alignment = miri:: AlignmentCheck :: Symbolic ;
551
- } else if arg == "-Zmiri-disable-abi-check" {
552
- eprintln ! (
553
- "WARNING: the flag `-Zmiri-disable-abi-check` no longer has any effect; \
554
- ABI checks cannot be disabled any more"
555
- ) ;
556
550
} else if arg == "-Zmiri-disable-isolation" {
557
- if matches ! ( isolation_enabled, Some ( true ) ) {
558
- show_error ! (
559
- "-Zmiri-disable-isolation cannot be used along with -Zmiri-isolation-error"
560
- ) ;
561
- } else {
562
- isolation_enabled = Some ( false ) ;
563
- }
564
551
miri_config. isolated_op = miri:: IsolatedOp :: Allow ;
565
552
} else if arg == "-Zmiri-disable-leak-backtraces" {
566
553
miri_config. collect_leak_backtraces = false ;
@@ -569,14 +556,6 @@ fn main() {
569
556
} else if arg == "-Zmiri-track-weak-memory-loads" {
570
557
miri_config. track_outdated_loads = true ;
571
558
} else if let Some ( param) = arg. strip_prefix ( "-Zmiri-isolation-error=" ) {
572
- if matches ! ( isolation_enabled, Some ( false ) ) {
573
- show_error ! (
574
- "-Zmiri-isolation-error cannot be used along with -Zmiri-disable-isolation"
575
- ) ;
576
- } else {
577
- isolation_enabled = Some ( true ) ;
578
- }
579
-
580
559
miri_config. isolated_op = match param {
581
560
"abort" => miri:: IsolatedOp :: Reject ( miri:: RejectOpWith :: Abort ) ,
582
561
"hide" => miri:: IsolatedOp :: Reject ( miri:: RejectOpWith :: NoWarning ) ,
@@ -622,10 +601,6 @@ fn main() {
622
601
many_seeds = Some ( 0 ..64 ) ;
623
602
} else if arg == "-Zmiri-many-seeds-keep-going" {
624
603
many_seeds_keep_going = true ;
625
- } else if let Some ( _param) = arg. strip_prefix ( "-Zmiri-env-exclude=" ) {
626
- show_error ! (
627
- "`-Zmiri-env-exclude` has been removed; unset env vars before starting Miri instead"
628
- ) ;
629
604
} else if let Some ( param) = arg. strip_prefix ( "-Zmiri-env-forward=" ) {
630
605
miri_config. forwarded_env_vars . push ( param. to_owned ( ) ) ;
631
606
} else if let Some ( param) = arg. strip_prefix ( "-Zmiri-env-set=" ) {
@@ -728,13 +703,20 @@ fn main() {
728
703
"-Zmiri-unique-is-unique only has an effect when -Zmiri-tree-borrows is also used"
729
704
) ;
730
705
}
731
- // Tree Borrows + permissive provenance does not work.
732
- if miri_config. provenance_mode == ProvenanceMode :: Permissive
733
- && matches ! ( miri_config. borrow_tracker, Some ( BorrowTrackerMethod :: TreeBorrows ) )
734
- {
735
- show_error ! (
736
- "Tree Borrows does not support integer-to-pointer casts, and is hence not compatible with permissive provenance"
737
- ) ;
706
+ // Tree Borrows implies strict provenance, and is not compatible with native calls.
707
+ if matches ! ( miri_config. borrow_tracker, Some ( BorrowTrackerMethod :: TreeBorrows ) ) {
708
+ if miri_config. provenance_mode != ProvenanceMode :: Strict {
709
+ show_error ! (
710
+ "Tree Borrows does not support integer-to-pointer casts, and hence requires strict provenance"
711
+ ) ;
712
+ }
713
+ if miri_config. native_lib . is_some ( ) {
714
+ show_error ! ( "Tree Borrows is not compatible with calling native functions" ) ;
715
+ }
716
+ }
717
+ // Native calls and strict provenance are not compatible.
718
+ if miri_config. native_lib . is_some ( ) && miri_config. provenance_mode == ProvenanceMode :: Strict {
719
+ show_error ! ( "strict provenance is not compatible with calling native functions" ) ;
738
720
}
739
721
// You can set either one seed or many.
740
722
if many_seeds. is_some ( ) && miri_config. seed . is_some ( ) {
0 commit comments