Skip to content

Commit 35f10b1

Browse files
committed
we generally make later flags overwrite earlier flags, so remove some logic guarding just against that
1 parent b109091 commit 35f10b1

File tree

2 files changed

+3
-18
lines changed

2 files changed

+3
-18
lines changed

Diff for: src/tools/miri/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,10 @@ environment variable. We first document the most relevant and most commonly used
294294
will always fail and `0.0` means it will never fail. Note that setting it to
295295
`1.0` will likely cause hangs, since it means programs using
296296
`compare_exchange_weak` cannot make progress.
297-
* `-Zmiri-disable-isolation` disables host isolation. As a consequence,
297+
* `-Zmiri-disable-isolation` disables host isolation. As a consequence,
298298
the program has access to host resources such as environment variables, file
299299
systems, and randomness.
300+
This overwrites a previous `-Zmiri-isolation-error`.
300301
* `-Zmiri-disable-leak-backtraces` disables backtraces reports for memory leaks. By default, a
301302
backtrace is captured for every allocation when it is created, just in case it leaks. This incurs
302303
some memory overhead to store data that is almost never used. This flag is implied by
@@ -317,6 +318,7 @@ environment variable. We first document the most relevant and most commonly used
317318
execution with a "permission denied" error being returned to the program.
318319
`warn` prints a full backtrace each time that happens; `warn-nobacktrace` is less
319320
verbose and shown at most once per operation. `hide` hides the warning entirely.
321+
This overwrites a previous `-Zmiri-disable-isolation`.
320322
* `-Zmiri-many-seeds=[<from>]..<to>` runs the program multiple times with different seeds for Miri's
321323
RNG. With different seeds, Miri will make different choices to resolve non-determinism such as the
322324
order in which concurrent threads are scheduled, or the exact addresses assigned to allocations.

Diff for: src/tools/miri/src/bin/miri.rs

-17
Original file line numberDiff line numberDiff line change
@@ -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`.
@@ -550,13 +548,6 @@ fn main() {
550548
} else if arg == "-Zmiri-symbolic-alignment-check" {
551549
miri_config.check_alignment = miri::AlignmentCheck::Symbolic;
552550
} else if arg == "-Zmiri-disable-isolation" {
553-
if matches!(isolation_enabled, Some(true)) {
554-
show_error!(
555-
"-Zmiri-disable-isolation cannot be used along with -Zmiri-isolation-error"
556-
);
557-
} else {
558-
isolation_enabled = Some(false);
559-
}
560551
miri_config.isolated_op = miri::IsolatedOp::Allow;
561552
} else if arg == "-Zmiri-disable-leak-backtraces" {
562553
miri_config.collect_leak_backtraces = false;
@@ -565,14 +556,6 @@ fn main() {
565556
} else if arg == "-Zmiri-track-weak-memory-loads" {
566557
miri_config.track_outdated_loads = true;
567558
} else if let Some(param) = arg.strip_prefix("-Zmiri-isolation-error=") {
568-
if matches!(isolation_enabled, Some(false)) {
569-
show_error!(
570-
"-Zmiri-isolation-error cannot be used along with -Zmiri-disable-isolation"
571-
);
572-
} else {
573-
isolation_enabled = Some(true);
574-
}
575-
576559
miri_config.isolated_op = match param {
577560
"abort" => miri::IsolatedOp::Reject(miri::RejectOpWith::Abort),
578561
"hide" => miri::IsolatedOp::Reject(miri::RejectOpWith::NoWarning),

0 commit comments

Comments
 (0)