Skip to content

Commit 2bbb70f

Browse files
committed
Auto merge of rust-lang#2203 - RalfJung:deprecate, r=oli-obk
deprecate -Zmiri-allow-uninit-numbers and -Zmiri-allow-ptr-int-transmute Cc rust-lang/miri#2187 rust-lang/miri#2188
2 parents 0a2a4b3 + 14913e9 commit 2bbb70f

File tree

5 files changed

+15
-2
lines changed

5 files changed

+15
-2
lines changed

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -309,13 +309,15 @@ to Miri failing to detect cases of undefined behavior in a program.
309309

310310
* `-Zmiri-allow-uninit-numbers` disables the check to ensure that number types (integer and float
311311
types) always hold initialized data. (They must still be initialized when any actual operation,
312-
such as arithmetic, is performed.) Using this flag is **unsound**. This has no effect when
312+
such as arithmetic, is performed.) Using this flag is **unsound** and
313+
[deprecated](https://github.com/rust-lang/miri/issues/2187). This has no effect when
313314
`-Zmiri-disable-validation` is present.
314315
* `-Zmiri-allow-ptr-int-transmute` makes Miri more accepting of transmutation between pointers and
315316
integers via `mem::transmute` or union/pointer type punning. This has two effects: it disables the
316317
check against integers storing a pointer (i.e., data with provenance), thus allowing
317318
pointer-to-integer transmutation, and it treats integer-to-pointer transmutation as equivalent to
318-
a cast. Using this flag is **unsound**.
319+
a cast. Using this flag is **unsound** and
320+
[deprecated](https://github.com/rust-lang/miri/issues/2188).
319321
* `-Zmiri-disable-abi-check` disables checking [function ABI]. Using this flag
320322
is **unsound**.
321323
* `-Zmiri-disable-alignment-check` disables checking pointer alignment, so you

src/bin/miri.rs

+8
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,16 @@ fn main() {
329329
since it is now enabled by default"
330330
);
331331
} else if arg == "-Zmiri-allow-uninit-numbers" {
332+
eprintln!(
333+
"WARNING: `-Zmiri-allow-uninit-numbers` is deprecated and planned to be removed. \
334+
Please let us know at <https://github.com/rust-lang/miri/issues/2187> if you rely on this flag."
335+
);
332336
miri_config.allow_uninit_numbers = true;
333337
} else if arg == "-Zmiri-allow-ptr-int-transmute" {
338+
eprintln!(
339+
"WARNING: `-Zmiri-allow-ptr-int-transmute` is deprecated and planned to be removed. \
340+
Please let us know at <https://github.com/rust-lang/miri/issues/2188> if you rely on this flag."
341+
);
334342
miri_config.allow_ptr_int_transmute = true;
335343
} else if arg == "-Zmiri-disable-abi-check" {
336344
miri_config.check_abi = false;

tests/fail/validity/invalid_enum_tag_256variants_uninit.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
WARNING: `-Zmiri-allow-uninit-numbers` is deprecated and planned to be removed. Please let us know at <https://github.com/rust-lang/miri/issues/2187> if you rely on this flag.
12
error: Undefined Behavior: type validation failed at .<enum-tag>: encountered uninitialized bytes, but expected a valid enum tag
23
--> $DIR/invalid_enum_tag_256variants_uninit.rs:LL:CC
34
|

tests/pass/move-uninit-primval.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
WARNING: `-Zmiri-allow-uninit-numbers` is deprecated and planned to be removed. Please let us know at <https://github.com/rust-lang/miri/issues/2187> if you rely on this flag.
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
WARNING: `-Zmiri-allow-uninit-numbers` is deprecated and planned to be removed. Please let us know at <https://github.com/rust-lang/miri/issues/2187> if you rely on this flag.

0 commit comments

Comments
 (0)