@@ -514,8 +514,6 @@ fn main() {
514514
515515 let mut rustc_args = vec ! [ ] ;
516516 let mut after_dashdash = false ;
517- // If user has explicitly enabled/disabled isolation
518- let mut isolation_enabled: Option < bool > = None ;
519517
520518 // Note that we require values to be given with `=`, not with a space.
521519 // This matches how rustc parses `-Z`.
@@ -539,6 +537,7 @@ fn main() {
539537 miri_config. borrow_tracker = None ;
540538 } else if arg == "-Zmiri-tree-borrows" {
541539 miri_config. borrow_tracker = Some ( BorrowTrackerMethod :: TreeBorrows ) ;
540+ miri_config. provenance_mode = ProvenanceMode :: Strict ;
542541 } else if arg == "-Zmiri-unique-is-unique" {
543542 miri_config. unique_is_unique = true ;
544543 } else if arg == "-Zmiri-disable-data-race-detector" {
@@ -548,19 +547,7 @@ fn main() {
548547 miri_config. check_alignment = miri:: AlignmentCheck :: None ;
549548 } else if arg == "-Zmiri-symbolic-alignment-check" {
550549 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- ) ;
556550 } 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- }
564551 miri_config. isolated_op = miri:: IsolatedOp :: Allow ;
565552 } else if arg == "-Zmiri-disable-leak-backtraces" {
566553 miri_config. collect_leak_backtraces = false ;
@@ -569,14 +556,6 @@ fn main() {
569556 } else if arg == "-Zmiri-track-weak-memory-loads" {
570557 miri_config. track_outdated_loads = true ;
571558 } 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-
580559 miri_config. isolated_op = match param {
581560 "abort" => miri:: IsolatedOp :: Reject ( miri:: RejectOpWith :: Abort ) ,
582561 "hide" => miri:: IsolatedOp :: Reject ( miri:: RejectOpWith :: NoWarning ) ,
@@ -622,10 +601,6 @@ fn main() {
622601 many_seeds = Some ( 0 ..64 ) ;
623602 } else if arg == "-Zmiri-many-seeds-keep-going" {
624603 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- ) ;
629604 } else if let Some ( param) = arg. strip_prefix ( "-Zmiri-env-forward=" ) {
630605 miri_config. forwarded_env_vars . push ( param. to_owned ( ) ) ;
631606 } else if let Some ( param) = arg. strip_prefix ( "-Zmiri-env-set=" ) {
@@ -728,13 +703,20 @@ fn main() {
728703 "-Zmiri-unique-is-unique only has an effect when -Zmiri-tree-borrows is also used"
729704 ) ;
730705 }
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" ) ;
738720 }
739721 // You can set either one seed or many.
740722 if many_seeds. is_some ( ) && miri_config. seed . is_some ( ) {
0 commit comments