diff --git a/README.md b/README.md index 6ccc9e25f69..50a43436dc2 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/src/bin/miri.rs b/src/bin/miri.rs index 64047d146c3..7dc642365c5 100644 --- a/src/bin/miri.rs +++ b/src/bin/miri.rs @@ -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 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 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; diff --git a/tests/fail/validity/invalid_enum_tag_256variants_uninit.stderr b/tests/fail/validity/invalid_enum_tag_256variants_uninit.stderr index 1a6039c477d..0e924bb741a 100644 --- a/tests/fail/validity/invalid_enum_tag_256variants_uninit.stderr +++ b/tests/fail/validity/invalid_enum_tag_256variants_uninit.stderr @@ -1,3 +1,4 @@ +WARNING: `-Zmiri-allow-uninit-numbers` is deprecated and planned to be removed. Please let us know at if you rely on this flag. error: Undefined Behavior: type validation failed at .: encountered uninitialized bytes, but expected a valid enum tag --> $DIR/invalid_enum_tag_256variants_uninit.rs:LL:CC | diff --git a/tests/pass/move-uninit-primval.stderr b/tests/pass/move-uninit-primval.stderr new file mode 100644 index 00000000000..d9f2331fe7f --- /dev/null +++ b/tests/pass/move-uninit-primval.stderr @@ -0,0 +1 @@ +WARNING: `-Zmiri-allow-uninit-numbers` is deprecated and planned to be removed. Please let us know at if you rely on this flag. diff --git a/tests/pass/uninit_number_ignored.stderr b/tests/pass/uninit_number_ignored.stderr new file mode 100644 index 00000000000..d9f2331fe7f --- /dev/null +++ b/tests/pass/uninit_number_ignored.stderr @@ -0,0 +1 @@ +WARNING: `-Zmiri-allow-uninit-numbers` is deprecated and planned to be removed. Please let us know at if you rely on this flag.