Skip to content

Commit

Permalink
Auto merge of #2203 - RalfJung:deprecate, r=oli-obk
Browse files Browse the repository at this point in the history
deprecate -Zmiri-allow-uninit-numbers and -Zmiri-allow-ptr-int-transmute

Cc #2187 #2188
  • Loading branch information
bors committed Jun 13, 2022
2 parents 0a2a4b3 + 14913e9 commit 2bbb70f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -309,13 +309,15 @@ to Miri failing to detect cases of undefined behavior in a program.

* `-Zmiri-allow-uninit-numbers` disables the check to ensure that number types (integer and float
types) always hold initialized data. (They must still be initialized when any actual operation,
such as arithmetic, is performed.) Using this flag is **unsound**. This has no effect when
such as arithmetic, is performed.) Using this flag is **unsound** and
[deprecated](https://github.com/rust-lang/miri/issues/2187). This has no effect when
`-Zmiri-disable-validation` is present.
* `-Zmiri-allow-ptr-int-transmute` makes Miri more accepting of transmutation between pointers and
integers via `mem::transmute` or union/pointer type punning. This has two effects: it disables the
check against integers storing a pointer (i.e., data with provenance), thus allowing
pointer-to-integer transmutation, and it treats integer-to-pointer transmutation as equivalent to
a cast. Using this flag is **unsound**.
a cast. Using this flag is **unsound** and
[deprecated](https://github.com/rust-lang/miri/issues/2188).
* `-Zmiri-disable-abi-check` disables checking [function ABI]. Using this flag
is **unsound**.
* `-Zmiri-disable-alignment-check` disables checking pointer alignment, so you
Expand Down
8 changes: 8 additions & 0 deletions src/bin/miri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,16 @@ fn main() {
since it is now enabled by default"
);
} else if arg == "-Zmiri-allow-uninit-numbers" {
eprintln!(
"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."
);
miri_config.allow_uninit_numbers = true;
} else if arg == "-Zmiri-allow-ptr-int-transmute" {
eprintln!(
"WARNING: `-Zmiri-allow-ptr-int-transmute` is deprecated and planned to be removed. \
Please let us know at <https://github.com/rust-lang/miri/issues/2188> if you rely on this flag."
);
miri_config.allow_ptr_int_transmute = true;
} else if arg == "-Zmiri-disable-abi-check" {
miri_config.check_abi = false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
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.
error: Undefined Behavior: type validation failed at .<enum-tag>: encountered uninitialized bytes, but expected a valid enum tag
--> $DIR/invalid_enum_tag_256variants_uninit.rs:LL:CC
|
Expand Down
1 change: 1 addition & 0 deletions tests/pass/move-uninit-primval.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +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 change: 1 addition & 0 deletions tests/pass/uninit_number_ignored.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +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 comments on commit 2bbb70f

Please sign in to comment.