diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index b1bfd612b90e5..d52455e2576c9 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -289,6 +289,7 @@ declare_lint! { "constant evaluation encountered erroneous expression", @future_incompatible = FutureIncompatibleInfo { reference: "issue #71800 ", + reason: FutureIncompatibilityReason::FutureReleaseErrorReportNow, }; report_in_external_macro } diff --git a/src/test/ui/array-slice-vec/array_const_index-0.stderr b/src/test/ui/array-slice-vec/array_const_index-0.stderr index 641705e1c6875..b44251efdea42 100644 --- a/src/test/ui/array-slice-vec/array_const_index-0.stderr +++ b/src/test/ui/array-slice-vec/array_const_index-0.stderr @@ -12,3 +12,16 @@ LL | const B: i32 = (&A)[1]; error: aborting due to previous error +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/array_const_index-0.rs:2:16 + | +LL | const B: i32 = (&A)[1]; + | ---------------^^^^^^^- + | | + | index out of bounds: the length is 0 but the index is 1 + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/array-slice-vec/array_const_index-1.stderr b/src/test/ui/array-slice-vec/array_const_index-1.stderr index 4d52d38af5e17..8beebafb04c32 100644 --- a/src/test/ui/array-slice-vec/array_const_index-1.stderr +++ b/src/test/ui/array-slice-vec/array_const_index-1.stderr @@ -12,3 +12,16 @@ LL | const B: i32 = A[1]; error: aborting due to previous error +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/array_const_index-1.rs:2:16 + | +LL | const B: i32 = A[1]; + | ---------------^^^^- + | | + | index out of bounds: the length is 0 but the index is 1 + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/associated-consts/defaults-not-assumed-fail.stderr b/src/test/ui/associated-consts/defaults-not-assumed-fail.stderr index 7406b2ddee9b2..f04ea0b747705 100644 --- a/src/test/ui/associated-consts/defaults-not-assumed-fail.stderr +++ b/src/test/ui/associated-consts/defaults-not-assumed-fail.stderr @@ -29,3 +29,28 @@ LL | assert_eq!(<() as Tr>::B, 0); // causes the error above error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/defaults-not-assumed-fail.rs:8:19 + | +LL | const B: u8 = Self::A + 1; + | --------------^^^^^^^^^^^- + | | + | attempt to compute `u8::MAX + 1_u8`, which would overflow + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: erroneous constant used + --> $DIR/defaults-not-assumed-fail.rs:34:5 + | +LL | assert_eq!(<() as Tr>::B, 0); // causes the error above + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info) + diff --git a/src/test/ui/borrowck/issue-81899.stderr b/src/test/ui/borrowck/issue-81899.stderr index 92ebd5a220d90..e7345ff3f9a64 100644 --- a/src/test/ui/borrowck/issue-81899.stderr +++ b/src/test/ui/borrowck/issue-81899.stderr @@ -27,3 +27,16 @@ LL | const _CONST: &[u8] = &f(&[], |_| {}); error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/issue-81899.rs:4:23 + | +LL | const _CONST: &[u8] = &f(&[], |_| {}); + | ----------------------^^^^^^^^^^^^^^^- + | | + | referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/borrowck/issue-88434-minimal-example.stderr b/src/test/ui/borrowck/issue-88434-minimal-example.stderr index d46cd862e34aa..47d83c6535583 100644 --- a/src/test/ui/borrowck/issue-88434-minimal-example.stderr +++ b/src/test/ui/borrowck/issue-88434-minimal-example.stderr @@ -27,3 +27,16 @@ LL | const _CONST: &() = &f(&|_| {}); error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/issue-88434-minimal-example.rs:3:21 + | +LL | const _CONST: &() = &f(&|_| {}); + | --------------------^^^^^^^^^^^- + | | + | referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/borrowck/issue-88434-removal-index-should-be-less.stderr b/src/test/ui/borrowck/issue-88434-removal-index-should-be-less.stderr index e6b07aba74d42..b08a7cfc7fe1a 100644 --- a/src/test/ui/borrowck/issue-88434-removal-index-should-be-less.stderr +++ b/src/test/ui/borrowck/issue-88434-removal-index-should-be-less.stderr @@ -27,3 +27,16 @@ LL | const _CONST: &[u8] = &f(&[], |_| {}); error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/issue-88434-removal-index-should-be-less.rs:3:23 + | +LL | const _CONST: &[u8] = &f(&[], |_| {}); + | ----------------------^^^^^^^^^^^^^^^- + | | + | referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/assert-type-intrinsics.stderr b/src/test/ui/consts/assert-type-intrinsics.stderr index bb57ee82cc16f..89f8f2ffc55cb 100644 --- a/src/test/ui/consts/assert-type-intrinsics.stderr +++ b/src/test/ui/consts/assert-type-intrinsics.stderr @@ -37,3 +37,45 @@ LL | | }; error: aborting due to 3 previous errors +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/assert-type-intrinsics.rs:14:9 + | +LL | / const _BAD1: () = unsafe { +LL | | MaybeUninit::::uninit().assume_init(); + | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to instantiate uninhabited type `!` +LL | | }; + | |______- + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/assert-type-intrinsics.rs:17:9 + | +LL | / const _BAD2: () = unsafe { +LL | | intrinsics::assert_uninit_valid::(); + | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to leave type `bool` uninitialized, which is invalid +LL | | }; + | |______- + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/assert-type-intrinsics.rs:20:9 + | +LL | / const _BAD3: () = unsafe { +LL | | intrinsics::assert_zero_valid::<&'static i32>(); + | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to zero-initialize type `&i32`, which is invalid +LL | | }; + | |______- + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/assoc_const_generic_impl.stderr b/src/test/ui/consts/assoc_const_generic_impl.stderr index 96cb904fa1b19..cccf62a8ff6d3 100644 --- a/src/test/ui/consts/assoc_const_generic_impl.stderr +++ b/src/test/ui/consts/assoc_const_generic_impl.stderr @@ -22,3 +22,20 @@ LL | let () = Self::I_AM_ZERO_SIZED; error: aborting due to previous error; 1 warning emitted +Future incompatibility report: Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/assoc_const_generic_impl.rs:11:34 + | +LL | const I_AM_ZERO_SIZED: () = [()][std::mem::size_of::()]; + | -----------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- + | | + | index out of bounds: the length is 1 but the index is 4 + | +note: the lint level is defined here + --> $DIR/assoc_const_generic_impl.rs:3:9 + | +LL | #![warn(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-err-early.stderr b/src/test/ui/consts/const-err-early.stderr index 2b3d881738762..385e770eb4f01 100644 --- a/src/test/ui/consts/const-err-early.stderr +++ b/src/test/ui/consts/const-err-early.stderr @@ -60,3 +60,88 @@ LL | pub const E: u8 = [5u8][1]; error: aborting due to 5 previous errors +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-err-early.rs:3:19 + | +LL | pub const A: i8 = -i8::MIN; + | ------------------^^^^^^^^- + | | + | attempt to negate `i8::MIN`, which would overflow + | +note: the lint level is defined here + --> $DIR/const-err-early.rs:1:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-err-early.rs:5:19 + | +LL | pub const B: u8 = 200u8 + 200u8; + | ------------------^^^^^^^^^^^^^- + | | + | attempt to compute `200_u8 + 200_u8`, which would overflow + | +note: the lint level is defined here + --> $DIR/const-err-early.rs:1:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-err-early.rs:7:19 + | +LL | pub const C: u8 = 200u8 * 4; + | ------------------^^^^^^^^^- + | | + | attempt to compute `200_u8 * 4_u8`, which would overflow + | +note: the lint level is defined here + --> $DIR/const-err-early.rs:1:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-err-early.rs:9:19 + | +LL | pub const D: u8 = 42u8 - (42u8 + 1); + | ------------------^^^^^^^^^^^^^^^^^- + | | + | attempt to compute `42_u8 - 43_u8`, which would overflow + | +note: the lint level is defined here + --> $DIR/const-err-early.rs:1:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-err-early.rs:11:19 + | +LL | pub const E: u8 = [5u8][1]; + | ------------------^^^^^^^^- + | | + | index out of bounds: the length is 1 but the index is 1 + | +note: the lint level is defined here + --> $DIR/const-err-early.rs:1:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-err-multi.stderr b/src/test/ui/consts/const-err-multi.stderr index c8172e83d10e2..a195459ff0884 100644 --- a/src/test/ui/consts/const-err-multi.stderr +++ b/src/test/ui/consts/const-err-multi.stderr @@ -49,3 +49,71 @@ LL | pub const D: i8 = 50 - A; error: aborting due to 4 previous errors +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-err-multi.rs:3:19 + | +LL | pub const A: i8 = -i8::MIN; + | ------------------^^^^^^^^- + | | + | attempt to negate `i8::MIN`, which would overflow + | +note: the lint level is defined here + --> $DIR/const-err-multi.rs:1:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-err-multi.rs:6:19 + | +LL | pub const B: i8 = A; + | ------------------^- + | | + | referenced constant has errors + | +note: the lint level is defined here + --> $DIR/const-err-multi.rs:1:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-err-multi.rs:9:19 + | +LL | pub const C: u8 = A as u8; + | ------------------^------- + | | + | referenced constant has errors + | +note: the lint level is defined here + --> $DIR/const-err-multi.rs:1:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-err-multi.rs:12:24 + | +LL | pub const D: i8 = 50 - A; + | -----------------------^- + | | + | referenced constant has errors + | +note: the lint level is defined here + --> $DIR/const-err-multi.rs:1:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-err.stderr b/src/test/ui/consts/const-err.stderr index 0c963874a8496..3b03e702dc4ae 100644 --- a/src/test/ui/consts/const-err.stderr +++ b/src/test/ui/consts/const-err.stderr @@ -29,3 +29,20 @@ LL | black_box((FOO, FOO)); error: aborting due to 2 previous errors; 1 warning emitted For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/const-err.rs:11:17 + | +LL | const FOO: u8 = [5u8][1]; + | ----------------^^^^^^^^- + | | + | index out of bounds: the length is 1 but the index is 1 + | +note: the lint level is defined here + --> $DIR/const-err.rs:5:9 + | +LL | #![warn(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-eval/conditional_array_execution.stderr b/src/test/ui/consts/const-eval/conditional_array_execution.stderr index 9dc40030a6ff8..f88bf4454260b 100644 --- a/src/test/ui/consts/const-eval/conditional_array_execution.stderr +++ b/src/test/ui/consts/const-eval/conditional_array_execution.stderr @@ -33,3 +33,36 @@ LL | println!("{}", FOO); error: aborting due to previous error; 2 warnings emitted For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/conditional_array_execution.rs:7:19 + | +LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize]; + | ------------------^^^^^--------------------------- + | | + | attempt to compute `5_u32 - 6_u32`, which would overflow + | +note: the lint level is defined here + --> $DIR/conditional_array_execution.rs:3:9 + | +LL | #![warn(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +warning: erroneous constant used + --> $DIR/conditional_array_execution.rs:12:20 + | +LL | println!("{}", FOO); + | ^^^ referenced constant has errors + | +note: the lint level is defined here + --> $DIR/conditional_array_execution.rs:3:9 + | +LL | #![warn(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + = note: this warning originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info) + diff --git a/src/test/ui/consts/const-eval/const-eval-overflow-2.stderr b/src/test/ui/consts/const-eval/const-eval-overflow-2.stderr index 26728cf541582..1c74b978827c6 100644 --- a/src/test/ui/consts/const-eval/const-eval-overflow-2.stderr +++ b/src/test/ui/consts/const-eval/const-eval-overflow-2.stderr @@ -12,3 +12,20 @@ LL | NEG_NEG_128 => println!("A"), error: aborting due to 2 previous errors +Future incompatibility report: Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/const-eval-overflow-2.rs:11:25 + | +LL | const NEG_NEG_128: i8 = -NEG_128; + | ------------------------^^^^^^^^- + | | + | attempt to negate `i8::MIN`, which would overflow + | +note: the lint level is defined here + --> $DIR/const-eval-overflow-2.rs:4:36 + | +LL | #![allow(unused_imports, warnings, const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-eval/const-eval-overflow2.stderr b/src/test/ui/consts/const-eval/const-eval-overflow2.stderr index 66e86c352d154..948ead521ea34 100644 --- a/src/test/ui/consts/const-eval/const-eval-overflow2.stderr +++ b/src/test/ui/consts/const-eval/const-eval-overflow2.stderr @@ -107,3 +107,153 @@ LL | | ); error: aborting due to 8 previous errors +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-eval-overflow2.rs:14:6 + | +LL | / const VALS_I8: (i8,) = +LL | | ( +LL | | i8::MIN - 1, + | | ^^^^^^^^^^^ attempt to compute `i8::MIN - 1_i8`, which would overflow +LL | | ); + | |_______- + | +note: the lint level is defined here + --> $DIR/const-eval-overflow2.rs:8:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-eval-overflow2.rs:21:6 + | +LL | / const VALS_I16: (i16,) = +LL | | ( +LL | | i16::MIN - 1, + | | ^^^^^^^^^^^^ attempt to compute `i16::MIN - 1_i16`, which would overflow +LL | | ); + | |_______- + | +note: the lint level is defined here + --> $DIR/const-eval-overflow2.rs:8:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-eval-overflow2.rs:28:6 + | +LL | / const VALS_I32: (i32,) = +LL | | ( +LL | | i32::MIN - 1, + | | ^^^^^^^^^^^^ attempt to compute `i32::MIN - 1_i32`, which would overflow +LL | | ); + | |_______- + | +note: the lint level is defined here + --> $DIR/const-eval-overflow2.rs:8:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-eval-overflow2.rs:35:6 + | +LL | / const VALS_I64: (i64,) = +LL | | ( +LL | | i64::MIN - 1, + | | ^^^^^^^^^^^^ attempt to compute `i64::MIN - 1_i64`, which would overflow +LL | | ); + | |_______- + | +note: the lint level is defined here + --> $DIR/const-eval-overflow2.rs:8:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-eval-overflow2.rs:42:6 + | +LL | / const VALS_U8: (u8,) = +LL | | ( +LL | | u8::MIN - 1, + | | ^^^^^^^^^^^ attempt to compute `0_u8 - 1_u8`, which would overflow +LL | | ); + | |_______- + | +note: the lint level is defined here + --> $DIR/const-eval-overflow2.rs:8:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-eval-overflow2.rs:48:6 + | +LL | / const VALS_U16: (u16,) = ( +LL | | u16::MIN - 1, + | | ^^^^^^^^^^^^ attempt to compute `0_u16 - 1_u16`, which would overflow +LL | | ); + | |_______- + | +note: the lint level is defined here + --> $DIR/const-eval-overflow2.rs:8:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-eval-overflow2.rs:54:6 + | +LL | / const VALS_U32: (u32,) = ( +LL | | u32::MIN - 1, + | | ^^^^^^^^^^^^ attempt to compute `0_u32 - 1_u32`, which would overflow +LL | | ); + | |_______- + | +note: the lint level is defined here + --> $DIR/const-eval-overflow2.rs:8:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-eval-overflow2.rs:61:6 + | +LL | / const VALS_U64: (u64,) = +LL | | ( +LL | | u64::MIN - 1, + | | ^^^^^^^^^^^^ attempt to compute `0_u64 - 1_u64`, which would overflow +LL | | ); + | |_______- + | +note: the lint level is defined here + --> $DIR/const-eval-overflow2.rs:8:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-eval/const-eval-overflow2b.stderr b/src/test/ui/consts/const-eval/const-eval-overflow2b.stderr index 3401ba4776500..5db6a49a98b0c 100644 --- a/src/test/ui/consts/const-eval/const-eval-overflow2b.stderr +++ b/src/test/ui/consts/const-eval/const-eval-overflow2b.stderr @@ -107,3 +107,153 @@ LL | | ); error: aborting due to 8 previous errors +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-eval-overflow2b.rs:14:6 + | +LL | / const VALS_I8: (i8,) = +LL | | ( +LL | | i8::MAX + 1, + | | ^^^^^^^^^^^ attempt to compute `i8::MAX + 1_i8`, which would overflow +LL | | ); + | |_______- + | +note: the lint level is defined here + --> $DIR/const-eval-overflow2b.rs:8:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-eval-overflow2b.rs:21:6 + | +LL | / const VALS_I16: (i16,) = +LL | | ( +LL | | i16::MAX + 1, + | | ^^^^^^^^^^^^ attempt to compute `i16::MAX + 1_i16`, which would overflow +LL | | ); + | |_______- + | +note: the lint level is defined here + --> $DIR/const-eval-overflow2b.rs:8:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-eval-overflow2b.rs:28:6 + | +LL | / const VALS_I32: (i32,) = +LL | | ( +LL | | i32::MAX + 1, + | | ^^^^^^^^^^^^ attempt to compute `i32::MAX + 1_i32`, which would overflow +LL | | ); + | |_______- + | +note: the lint level is defined here + --> $DIR/const-eval-overflow2b.rs:8:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-eval-overflow2b.rs:35:6 + | +LL | / const VALS_I64: (i64,) = +LL | | ( +LL | | i64::MAX + 1, + | | ^^^^^^^^^^^^ attempt to compute `i64::MAX + 1_i64`, which would overflow +LL | | ); + | |_______- + | +note: the lint level is defined here + --> $DIR/const-eval-overflow2b.rs:8:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-eval-overflow2b.rs:42:6 + | +LL | / const VALS_U8: (u8,) = +LL | | ( +LL | | u8::MAX + 1, + | | ^^^^^^^^^^^ attempt to compute `u8::MAX + 1_u8`, which would overflow +LL | | ); + | |_______- + | +note: the lint level is defined here + --> $DIR/const-eval-overflow2b.rs:8:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-eval-overflow2b.rs:48:6 + | +LL | / const VALS_U16: (u16,) = ( +LL | | u16::MAX + 1, + | | ^^^^^^^^^^^^ attempt to compute `u16::MAX + 1_u16`, which would overflow +LL | | ); + | |_______- + | +note: the lint level is defined here + --> $DIR/const-eval-overflow2b.rs:8:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-eval-overflow2b.rs:54:6 + | +LL | / const VALS_U32: (u32,) = ( +LL | | u32::MAX + 1, + | | ^^^^^^^^^^^^ attempt to compute `u32::MAX + 1_u32`, which would overflow +LL | | ); + | |_______- + | +note: the lint level is defined here + --> $DIR/const-eval-overflow2b.rs:8:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-eval-overflow2b.rs:61:6 + | +LL | / const VALS_U64: (u64,) = +LL | | ( +LL | | u64::MAX + 1, + | | ^^^^^^^^^^^^ attempt to compute `u64::MAX + 1_u64`, which would overflow +LL | | ); + | |_______- + | +note: the lint level is defined here + --> $DIR/const-eval-overflow2b.rs:8:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-eval/const-eval-overflow2c.stderr b/src/test/ui/consts/const-eval/const-eval-overflow2c.stderr index 93c64090f0eeb..ec3f3c110596b 100644 --- a/src/test/ui/consts/const-eval/const-eval-overflow2c.stderr +++ b/src/test/ui/consts/const-eval/const-eval-overflow2c.stderr @@ -107,3 +107,153 @@ LL | | ); error: aborting due to 8 previous errors +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-eval-overflow2c.rs:14:6 + | +LL | / const VALS_I8: (i8,) = +LL | | ( +LL | | i8::MIN * 2, + | | ^^^^^^^^^^^ attempt to compute `i8::MIN * 2_i8`, which would overflow +LL | | ); + | |_______- + | +note: the lint level is defined here + --> $DIR/const-eval-overflow2c.rs:8:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-eval-overflow2c.rs:21:6 + | +LL | / const VALS_I16: (i16,) = +LL | | ( +LL | | i16::MIN * 2, + | | ^^^^^^^^^^^^ attempt to compute `i16::MIN * 2_i16`, which would overflow +LL | | ); + | |_______- + | +note: the lint level is defined here + --> $DIR/const-eval-overflow2c.rs:8:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-eval-overflow2c.rs:28:6 + | +LL | / const VALS_I32: (i32,) = +LL | | ( +LL | | i32::MIN * 2, + | | ^^^^^^^^^^^^ attempt to compute `i32::MIN * 2_i32`, which would overflow +LL | | ); + | |_______- + | +note: the lint level is defined here + --> $DIR/const-eval-overflow2c.rs:8:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-eval-overflow2c.rs:35:6 + | +LL | / const VALS_I64: (i64,) = +LL | | ( +LL | | i64::MIN * 2, + | | ^^^^^^^^^^^^ attempt to compute `i64::MIN * 2_i64`, which would overflow +LL | | ); + | |_______- + | +note: the lint level is defined here + --> $DIR/const-eval-overflow2c.rs:8:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-eval-overflow2c.rs:42:6 + | +LL | / const VALS_U8: (u8,) = +LL | | ( +LL | | u8::MAX * 2, + | | ^^^^^^^^^^^ attempt to compute `u8::MAX * 2_u8`, which would overflow +LL | | ); + | |_______- + | +note: the lint level is defined here + --> $DIR/const-eval-overflow2c.rs:8:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-eval-overflow2c.rs:48:6 + | +LL | / const VALS_U16: (u16,) = ( +LL | | u16::MAX * 2, + | | ^^^^^^^^^^^^ attempt to compute `u16::MAX * 2_u16`, which would overflow +LL | | ); + | |_______- + | +note: the lint level is defined here + --> $DIR/const-eval-overflow2c.rs:8:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-eval-overflow2c.rs:54:6 + | +LL | / const VALS_U32: (u32,) = ( +LL | | u32::MAX * 2, + | | ^^^^^^^^^^^^ attempt to compute `u32::MAX * 2_u32`, which would overflow +LL | | ); + | |_______- + | +note: the lint level is defined here + --> $DIR/const-eval-overflow2c.rs:8:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-eval-overflow2c.rs:61:6 + | +LL | / const VALS_U64: (u64,) = +LL | | ( +LL | | u64::MAX * 2, + | | ^^^^^^^^^^^^ attempt to compute `u64::MAX * 2_u64`, which would overflow +LL | | ); + | |_______- + | +note: the lint level is defined here + --> $DIR/const-eval-overflow2c.rs:8:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-eval/const-eval-query-stack.stderr b/src/test/ui/consts/const-eval/const-eval-query-stack.stderr index b74d5a2722bd8..bbec2a830e64b 100644 --- a/src/test/ui/consts/const-eval/const-eval-query-stack.stderr +++ b/src/test/ui/consts/const-eval/const-eval-query-stack.stderr @@ -35,3 +35,31 @@ query stack during panic: #1 [optimized_mir] optimizing MIR for `main` #2 [collect_and_partition_mono_items] collect_and_partition_mono_items end of query stack +Future incompatibility report: Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/const-eval-query-stack.rs:19:16 + | +LL | const X: i32 = 1 / 0; + | ---------------^^^^^- + | | + | attempt to divide `1_i32` by zero + | +note: the lint level is defined here + --> $DIR/const-eval-query-stack.rs:18:8 + | +LL | #[warn(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: erroneous constant used + --> $DIR/const-eval-query-stack.rs:23:27 + | +LL | let x: &'static i32 = &X; + | ^^ referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-eval/const-pointer-values-in-various-types.64bit.stderr b/src/test/ui/consts/const-eval/const-pointer-values-in-various-types.64bit.stderr index c19f6342b5ba6..b004637fd8300 100644 --- a/src/test/ui/consts/const-eval/const-pointer-values-in-various-types.64bit.stderr +++ b/src/test/ui/consts/const-eval/const-pointer-values-in-various-types.64bit.stderr @@ -321,3 +321,354 @@ LL | const STR_CHAR_UNION: char = unsafe { Nonsense { stringy: "3" }.charact error: aborting due to 29 previous errors For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-pointer-values-in-various-types.rs:26:49 + | +LL | const I32_REF_USIZE_UNION: usize = unsafe { Nonsense { int_32_ref: &3 }.u }; + | --------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-pointer-values-in-various-types.rs:30:43 + | +LL | const I32_REF_U8_UNION: u8 = unsafe { Nonsense { int_32_ref: &3 }.uint_8 }; + | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-pointer-values-in-various-types.rs:34:45 + | +LL | const I32_REF_U16_UNION: u16 = unsafe { Nonsense { int_32_ref: &3 }.uint_16 }; + | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-pointer-values-in-various-types.rs:38:45 + | +LL | const I32_REF_U32_UNION: u32 = unsafe { Nonsense { int_32_ref: &3 }.uint_32 }; + | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-pointer-values-in-various-types.rs:42:45 + | +LL | const I32_REF_U64_UNION: u64 = unsafe { Nonsense { int_32_ref: &3 }.uint_64 }; + | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-pointer-values-in-various-types.rs:49:43 + | +LL | const I32_REF_I8_UNION: i8 = unsafe { Nonsense { int_32_ref: &3 }.int_8 }; + | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-pointer-values-in-various-types.rs:53:45 + | +LL | const I32_REF_I16_UNION: i16 = unsafe { Nonsense { int_32_ref: &3 }.int_16 }; + | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-pointer-values-in-various-types.rs:57:45 + | +LL | const I32_REF_I32_UNION: i32 = unsafe { Nonsense { int_32_ref: &3 }.int_32 }; + | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-pointer-values-in-various-types.rs:61:45 + | +LL | const I32_REF_I64_UNION: i64 = unsafe { Nonsense { int_32_ref: &3 }.int_64 }; + | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-pointer-values-in-various-types.rs:68:45 + | +LL | const I32_REF_F32_UNION: f32 = unsafe { Nonsense { int_32_ref: &3 }.float_32 }; + | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-pointer-values-in-various-types.rs:72:45 + | +LL | const I32_REF_F64_UNION: f64 = unsafe { Nonsense { int_32_ref: &3 }.float_64 }; + | ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-pointer-values-in-various-types.rs:76:47 + | +LL | const I32_REF_BOOL_UNION: bool = unsafe { Nonsense { int_32_ref: &3 }.truthy_falsey }; + | ------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-pointer-values-in-various-types.rs:80:47 + | +LL | const I32_REF_CHAR_UNION: char = unsafe { Nonsense { int_32_ref: &3 }.character }; + | ------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-pointer-values-in-various-types.rs:84:39 + | +LL | const STR_U8_UNION: u8 = unsafe { Nonsense { stringy: "3" }.uint_8 }; + | ----------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-pointer-values-in-various-types.rs:88:41 + | +LL | const STR_U16_UNION: u16 = unsafe { Nonsense { stringy: "3" }.uint_16 }; + | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-pointer-values-in-various-types.rs:92:41 + | +LL | const STR_U32_UNION: u32 = unsafe { Nonsense { stringy: "3" }.uint_32 }; + | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-pointer-values-in-various-types.rs:96:41 + | +LL | const STR_U64_UNION: u64 = unsafe { Nonsense { stringy: "3" }.uint_64 }; + | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-pointer-values-in-various-types.rs:100:43 + | +LL | const STR_U128_UNION: u128 = unsafe { Nonsense { stringy: "3" }.uint_128 }; + | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-pointer-values-in-various-types.rs:104:39 + | +LL | const STR_I8_UNION: i8 = unsafe { Nonsense { stringy: "3" }.int_8 }; + | ----------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-pointer-values-in-various-types.rs:108:41 + | +LL | const STR_I16_UNION: i16 = unsafe { Nonsense { stringy: "3" }.int_16 }; + | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-pointer-values-in-various-types.rs:112:41 + | +LL | const STR_I32_UNION: i32 = unsafe { Nonsense { stringy: "3" }.int_32 }; + | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-pointer-values-in-various-types.rs:116:41 + | +LL | const STR_I64_UNION: i64 = unsafe { Nonsense { stringy: "3" }.int_64 }; + | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-pointer-values-in-various-types.rs:120:43 + | +LL | const STR_I128_UNION: i128 = unsafe { Nonsense { stringy: "3" }.int_128 }; + | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-pointer-values-in-various-types.rs:124:41 + | +LL | const STR_F32_UNION: f32 = unsafe { Nonsense { stringy: "3" }.float_32 }; + | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-pointer-values-in-various-types.rs:128:41 + | +LL | const STR_F64_UNION: f64 = unsafe { Nonsense { stringy: "3" }.float_64 }; + | ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-pointer-values-in-various-types.rs:132:43 + | +LL | const STR_BOOL_UNION: bool = unsafe { Nonsense { stringy: "3" }.truthy_falsey }; + | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-pointer-values-in-various-types.rs:136:43 + | +LL | const STR_CHAR_UNION: char = unsafe { Nonsense { stringy: "3" }.character }; + | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-eval/const_fn_ptr_fail2.stderr b/src/test/ui/consts/const-eval/const_fn_ptr_fail2.stderr index c17166263ba09..daf3d8927c19a 100644 --- a/src/test/ui/consts/const-eval/const_fn_ptr_fail2.stderr +++ b/src/test/ui/consts/const-eval/const_fn_ptr_fail2.stderr @@ -21,3 +21,79 @@ LL | x(y) error: aborting due to 2 previous errors; 1 warning emitted For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/const_fn_ptr_fail2.rs:12:5 + | +LL | x(y) + | ^^^^ + | | + | calling non-const function `double` + | inside `bar` at $DIR/const_fn_ptr_fail2.rs:12:5 + | inside `Y` at $DIR/const_fn_ptr_fail2.rs:15:18 +... +LL | const Y: usize = bar(X, 2); // FIXME: should fail to typeck someday + | --------------------------- + | +note: the lint level is defined here + --> $DIR/const_fn_ptr_fail2.rs:4:10 + | +LL | #![allow(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/const_fn_ptr_fail2.rs:12:5 + | +LL | x(y) + | ^^^^ + | | + | calling non-const function `double` + | inside `bar` at $DIR/const_fn_ptr_fail2.rs:12:5 + | inside `Z` at $DIR/const_fn_ptr_fail2.rs:16:18 +... +LL | const Z: usize = bar(double, 2); // FIXME: should fail to typeck someday + | -------------------------------- + | +note: the lint level is defined here + --> $DIR/const_fn_ptr_fail2.rs:4:10 + | +LL | #![allow(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +warning: erroneous constant used + --> $DIR/const_fn_ptr_fail2.rs:19:5 + | +LL | assert_eq!(Y, 4); + | ^^^^^^^^^^^^^^^^ referenced constant has errors + | +note: the lint level is defined here + --> $DIR/const_fn_ptr_fail2.rs:4:10 + | +LL | #![allow(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + = note: this warning originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info) + +Future breakage diagnostic: +warning: erroneous constant used + --> $DIR/const_fn_ptr_fail2.rs:21:5 + | +LL | assert_eq!(Z, 4); + | ^^^^^^^^^^^^^^^^ referenced constant has errors + | +note: the lint level is defined here + --> $DIR/const_fn_ptr_fail2.rs:4:10 + | +LL | #![allow(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + = note: this warning originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info) + diff --git a/src/test/ui/consts/const-eval/erroneous-const.stderr b/src/test/ui/consts/const-eval/erroneous-const.stderr index 7e2a60929c73d..9057b58ded9da 100644 --- a/src/test/ui/consts/const-eval/erroneous-const.stderr +++ b/src/test/ui/consts/const-eval/erroneous-const.stderr @@ -41,3 +41,20 @@ LL | pub static FOO: () = no_codegen::(); error: aborting due to previous error; 2 warnings emitted For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/erroneous-const.rs:6:22 + | +LL | const VOID: () = [()][2]; + | -----------------^^^^^^^- + | | + | index out of bounds: the length is 1 but the index is 2 + | +note: the lint level is defined here + --> $DIR/erroneous-const.rs:2:9 + | +LL | #![warn(const_err, unconditional_panic)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-eval/erroneous-const2.stderr b/src/test/ui/consts/const-eval/erroneous-const2.stderr index 813d3ee249fb2..bf6cc8410a7ee 100644 --- a/src/test/ui/consts/const-eval/erroneous-const2.stderr +++ b/src/test/ui/consts/const-eval/erroneous-const2.stderr @@ -35,3 +35,20 @@ LL | let _ = PrintName::::VOID; error: aborting due to previous error; 2 warnings emitted For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/erroneous-const2.rs:6:22 + | +LL | const VOID: () = [()][2]; + | -----------------^^^^^^^- + | | + | index out of bounds: the length is 1 but the index is 2 + | +note: the lint level is defined here + --> $DIR/erroneous-const2.rs:2:9 + | +LL | #![warn(const_err, unconditional_panic)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-eval/format.stderr b/src/test/ui/consts/const-eval/format.stderr index 44f436ae4e3a9..b00cadcea991f 100644 --- a/src/test/ui/consts/const-eval/format.stderr +++ b/src/test/ui/consts/const-eval/format.stderr @@ -76,3 +76,49 @@ LL | println!("{:?}", 0); error: aborting due to 8 previous errors For more information about this error, try `rustc --explain E0015`. +Future incompatibility report: Future breakage diagnostic: +error: erroneous constant used + --> $DIR/format.rs:2:12 + | +LL | panic!("{:?}", 0); + | ^^^^^^ referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: erroneous constant used + --> $DIR/format.rs:2:20 + | +LL | panic!("{:?}", 0); + | ^ referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + = note: this error originates in the macro `$crate::const_format_args` (in Nightly builds, run with -Z macro-backtrace for more info) + +Future breakage diagnostic: +error: erroneous constant used + --> $DIR/format.rs:11:14 + | +LL | println!("{:?}", 0); + | ^^^^^^ referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: erroneous constant used + --> $DIR/format.rs:11:22 + | +LL | println!("{:?}", 0); + | ^ referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + = note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info) + diff --git a/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.stderr b/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.stderr index 73664fa49d189..7b3e46fccca7b 100644 --- a/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.stderr +++ b/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.stderr @@ -22,3 +22,20 @@ LL | let _ = PrintName::::VOID; error: aborting due to previous error; 1 warning emitted +Future incompatibility report: Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/index-out-of-bounds-never-type.rs:10:61 + | +LL | const VOID: ! = { let x = 0 * std::mem::size_of::(); [][x] }; + | --------------------------------------------------------^^^^^--- + | | + | index out of bounds: the length is 0 but the index is 0 + | +note: the lint level is defined here + --> $DIR/index-out-of-bounds-never-type.rs:4:9 + | +LL | #![warn(const_err, unconditional_panic)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-eval/issue-43197.stderr b/src/test/ui/consts/const-eval/issue-43197.stderr index 32ab7c74b891f..53ed32638ced2 100644 --- a/src/test/ui/consts/const-eval/issue-43197.stderr +++ b/src/test/ui/consts/const-eval/issue-43197.stderr @@ -60,3 +60,69 @@ LL | println!("{} {}", X, Y); error: aborting due to 2 previous errors; 4 warnings emitted For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/issue-43197.rs:10:20 + | +LL | const X: u32 = 0 - 1; + | ---------------^^^^^- + | | + | attempt to compute `0_u32 - 1_u32`, which would overflow + | +note: the lint level is defined here + --> $DIR/issue-43197.rs:3:9 + | +LL | #![warn(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/issue-43197.rs:13:24 + | +LL | const Y: u32 = foo(0 - 1); + | -------------------^^^^^-- + | | + | attempt to compute `0_u32 - 1_u32`, which would overflow + | +note: the lint level is defined here + --> $DIR/issue-43197.rs:3:9 + | +LL | #![warn(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +warning: erroneous constant used + --> $DIR/issue-43197.rs:16:23 + | +LL | println!("{} {}", X, Y); + | ^ referenced constant has errors + | +note: the lint level is defined here + --> $DIR/issue-43197.rs:3:9 + | +LL | #![warn(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + = note: this warning originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info) + +Future breakage diagnostic: +warning: erroneous constant used + --> $DIR/issue-43197.rs:16:26 + | +LL | println!("{} {}", X, Y); + | ^ referenced constant has errors + | +note: the lint level is defined here + --> $DIR/issue-43197.rs:3:9 + | +LL | #![warn(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + = note: this warning originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info) + diff --git a/src/test/ui/consts/const-eval/issue-44578.stderr b/src/test/ui/consts/const-eval/issue-44578.stderr index bff9f40f82b35..5ecdb7ef5568b 100644 --- a/src/test/ui/consts/const-eval/issue-44578.stderr +++ b/src/test/ui/consts/const-eval/issue-44578.stderr @@ -7,3 +7,36 @@ LL | println!("{}", as Foo>::AMT); error: aborting due to previous error For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/issue-44578.rs:15:24 + | +LL | const AMT: usize = [A::AMT][(A::AMT > B::AMT) as usize]; + | -------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- + | | + | index out of bounds: the length is 1 but the index is 1 + | +note: the lint level is defined here + --> $DIR/issue-44578.rs:3:10 + | +LL | #![allow(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +warning: erroneous constant used + --> $DIR/issue-44578.rs:27:20 + | +LL | println!("{}", as Foo>::AMT); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors + | +note: the lint level is defined here + --> $DIR/issue-44578.rs:3:10 + | +LL | #![allow(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + = note: this warning originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info) + diff --git a/src/test/ui/consts/const-eval/issue-50814-2.stderr b/src/test/ui/consts/const-eval/issue-50814-2.stderr index 298f0a4a446dd..67af3b2b1d3ae 100644 --- a/src/test/ui/consts/const-eval/issue-50814-2.stderr +++ b/src/test/ui/consts/const-eval/issue-50814-2.stderr @@ -25,3 +25,16 @@ LL | println!("{:x}", foo::<()>() as *const usize as usize); error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/issue-50814-2.rs:14:24 + | +LL | const BAR: usize = [5, 6, 7][T::BOO]; + | -------------------^^^^^^^^^^^^^^^^^- + | | + | index out of bounds: the length is 3 but the index is 42 + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-eval/issue-50814.stderr b/src/test/ui/consts/const-eval/issue-50814.stderr index 87bea28e76325..b82bc9ca2f81a 100644 --- a/src/test/ui/consts/const-eval/issue-50814.stderr +++ b/src/test/ui/consts/const-eval/issue-50814.stderr @@ -25,3 +25,16 @@ LL | foo(0); error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/issue-50814.rs:15:21 + | +LL | const MAX: u8 = A::MAX + B::MAX; + | ----------------^^^^^^^^^^^^^^^- + | | + | attempt to compute `u8::MAX + u8::MAX`, which would overflow + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-eval/partial_ptr_overwrite.stderr b/src/test/ui/consts/const-eval/partial_ptr_overwrite.stderr index a18c7e78d95af..1a7d386142097 100644 --- a/src/test/ui/consts/const-eval/partial_ptr_overwrite.stderr +++ b/src/test/ui/consts/const-eval/partial_ptr_overwrite.stderr @@ -18,3 +18,22 @@ LL | | }; error: aborting due to previous error +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/partial_ptr_overwrite.rs:8:9 + | +LL | / const PARTIAL_OVERWRITE: () = { +LL | | let mut p = &42; +LL | | unsafe { +LL | | let ptr: *mut _ = &mut p; +LL | | *(ptr as *mut u8) = 123; + | | ^^^^^^^^^^^^^^^^^^^^^^^ unable to overwrite parts of a pointer in memory at alloc4 +... | +LL | | let x = *p; +LL | | }; + | |__- + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-eval/promoted_errors.noopt.stderr b/src/test/ui/consts/const-eval/promoted_errors.noopt.stderr index 5bfd4ef92a975..be845339dfe67 100644 --- a/src/test/ui/consts/const-eval/promoted_errors.noopt.stderr +++ b/src/test/ui/consts/const-eval/promoted_errors.noopt.stderr @@ -85,3 +85,53 @@ LL | | }; warning: 7 warnings emitted +Future incompatibility report: Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/promoted_errors.rs:15:5 + | +LL | 0 - 1 + | ^^^^^ + | | + | attempt to compute `0_u32 - 1_u32`, which would overflow + | inside `overflow` at $DIR/promoted_errors.rs:15:5 + | inside `X` at $DIR/promoted_errors.rs:43:29 +... +LL | / const X: () = { +LL | | let _x: &'static u32 = &overflow(); +LL | | +LL | | +... | +LL | | let _x: &'static i32 = &oob(); +LL | | }; + | |__- + | +note: the lint level is defined here + --> $DIR/promoted_errors.rs:11:9 + | +LL | #![warn(const_err, arithmetic_overflow, unconditional_panic)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/promoted_errors.rs:43:28 + | +LL | / const X: () = { +LL | | let _x: &'static u32 = &overflow(); + | | ^^^^^^^^^^^ referenced constant has errors +LL | | +LL | | +... | +LL | | let _x: &'static i32 = &oob(); +LL | | }; + | |__- + | +note: the lint level is defined here + --> $DIR/promoted_errors.rs:11:9 + | +LL | #![warn(const_err, arithmetic_overflow, unconditional_panic)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-eval/promoted_errors.opt.stderr b/src/test/ui/consts/const-eval/promoted_errors.opt.stderr index 0a8a8aef3cf8f..c91d52336c36d 100644 --- a/src/test/ui/consts/const-eval/promoted_errors.opt.stderr +++ b/src/test/ui/consts/const-eval/promoted_errors.opt.stderr @@ -86,3 +86,54 @@ LL | | }; warning: 7 warnings emitted +Future incompatibility report: Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/promoted_errors.rs:21:5 + | +LL | 1 / 0 + | ^^^^^ + | | + | attempt to divide `1_i32` by zero + | inside `div_by_zero1` at $DIR/promoted_errors.rs:21:5 + | inside `X` at $DIR/promoted_errors.rs:46:29 +... +LL | / const X: () = { +LL | | let _x: &'static u32 = &overflow(); +LL | | +LL | | +... | +LL | | let _x: &'static i32 = &oob(); +LL | | }; + | |__- + | +note: the lint level is defined here + --> $DIR/promoted_errors.rs:11:9 + | +LL | #![warn(const_err, arithmetic_overflow, unconditional_panic)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/promoted_errors.rs:46:28 + | +LL | / const X: () = { +LL | | let _x: &'static u32 = &overflow(); +LL | | +LL | | +LL | | let _x: &'static i32 = &div_by_zero1(); + | | ^^^^^^^^^^^^^^^ referenced constant has errors +... | +LL | | let _x: &'static i32 = &oob(); +LL | | }; + | |__- + | +note: the lint level is defined here + --> $DIR/promoted_errors.rs:11:9 + | +LL | #![warn(const_err, arithmetic_overflow, unconditional_panic)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-eval/promoted_errors.opt_with_overflow_checks.stderr b/src/test/ui/consts/const-eval/promoted_errors.opt_with_overflow_checks.stderr index 5bfd4ef92a975..be845339dfe67 100644 --- a/src/test/ui/consts/const-eval/promoted_errors.opt_with_overflow_checks.stderr +++ b/src/test/ui/consts/const-eval/promoted_errors.opt_with_overflow_checks.stderr @@ -85,3 +85,53 @@ LL | | }; warning: 7 warnings emitted +Future incompatibility report: Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/promoted_errors.rs:15:5 + | +LL | 0 - 1 + | ^^^^^ + | | + | attempt to compute `0_u32 - 1_u32`, which would overflow + | inside `overflow` at $DIR/promoted_errors.rs:15:5 + | inside `X` at $DIR/promoted_errors.rs:43:29 +... +LL | / const X: () = { +LL | | let _x: &'static u32 = &overflow(); +LL | | +LL | | +... | +LL | | let _x: &'static i32 = &oob(); +LL | | }; + | |__- + | +note: the lint level is defined here + --> $DIR/promoted_errors.rs:11:9 + | +LL | #![warn(const_err, arithmetic_overflow, unconditional_panic)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/promoted_errors.rs:43:28 + | +LL | / const X: () = { +LL | | let _x: &'static u32 = &overflow(); + | | ^^^^^^^^^^^ referenced constant has errors +LL | | +LL | | +... | +LL | | let _x: &'static i32 = &oob(); +LL | | }; + | |__- + | +note: the lint level is defined here + --> $DIR/promoted_errors.rs:11:9 + | +LL | #![warn(const_err, arithmetic_overflow, unconditional_panic)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-eval/pub_const_err.stderr b/src/test/ui/consts/const-eval/pub_const_err.stderr index dd47dca2b2e40..56d66827626b9 100644 --- a/src/test/ui/consts/const-eval/pub_const_err.stderr +++ b/src/test/ui/consts/const-eval/pub_const_err.stderr @@ -16,3 +16,20 @@ LL | #![warn(const_err)] warning: 1 warning emitted +Future incompatibility report: Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/pub_const_err.rs:6:20 + | +LL | pub const Z: u32 = 0 - 1; + | -------------------^^^^^- + | | + | attempt to compute `0_u32 - 1_u32`, which would overflow + | +note: the lint level is defined here + --> $DIR/pub_const_err.rs:2:9 + | +LL | #![warn(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-eval/pub_const_err_bin.stderr b/src/test/ui/consts/const-eval/pub_const_err_bin.stderr index 9f413fb8fd770..202ea781e975d 100644 --- a/src/test/ui/consts/const-eval/pub_const_err_bin.stderr +++ b/src/test/ui/consts/const-eval/pub_const_err_bin.stderr @@ -16,3 +16,20 @@ LL | #![warn(const_err)] warning: 1 warning emitted +Future incompatibility report: Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/pub_const_err_bin.rs:4:20 + | +LL | pub const Z: u32 = 0 - 1; + | -------------------^^^^^- + | | + | attempt to compute `0_u32 - 1_u32`, which would overflow + | +note: the lint level is defined here + --> $DIR/pub_const_err_bin.rs:2:9 + | +LL | #![warn(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-eval/ref_to_int_match.32bit.stderr b/src/test/ui/consts/const-eval/ref_to_int_match.32bit.stderr index 83ac6c90a43a8..a55fd8c156e07 100644 --- a/src/test/ui/consts/const-eval/ref_to_int_match.32bit.stderr +++ b/src/test/ui/consts/const-eval/ref_to_int_match.32bit.stderr @@ -24,3 +24,16 @@ LL | 10..=BAR => {}, error: aborting due to 3 previous errors +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ref_to_int_match.rs:25:27 + | +LL | const BAR: Int = unsafe { Foo { r: &42 }.f }; + | --------------------------^^^^^^^^^^^^^^^^--- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-eval/ref_to_int_match.64bit.stderr b/src/test/ui/consts/const-eval/ref_to_int_match.64bit.stderr index 83ac6c90a43a8..a55fd8c156e07 100644 --- a/src/test/ui/consts/const-eval/ref_to_int_match.64bit.stderr +++ b/src/test/ui/consts/const-eval/ref_to_int_match.64bit.stderr @@ -24,3 +24,16 @@ LL | 10..=BAR => {}, error: aborting due to 3 previous errors +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ref_to_int_match.rs:25:27 + | +LL | const BAR: Int = unsafe { Foo { r: &42 }.f }; + | --------------------------^^^^^^^^^^^^^^^^--- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-eval/ub-enum.32bit.stderr b/src/test/ui/consts/const-eval/ub-enum.32bit.stderr index c6fa14d0534f4..2440cd2272c6c 100644 --- a/src/test/ui/consts/const-eval/ub-enum.32bit.stderr +++ b/src/test/ui/consts/const-eval/ub-enum.32bit.stderr @@ -125,3 +125,58 @@ LL | const BAD_UNINHABITED_WITH_DATA2: Result<(i32, !), (i32, Never)> = unsafe { error: aborting due to 13 previous errors For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-enum.rs:26:1 + | +LL | const BAD_ENUM_PTR: Enum = unsafe { mem::transmute(&1) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-enum.rs:30:1 + | +LL | const BAD_ENUM_WRAPPED: Wrap = unsafe { mem::transmute(&1) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-enum.rs:45:1 + | +LL | const BAD_ENUM2_PTR: Enum2 = unsafe { mem::transmute(&0) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-enum.rs:49:1 + | +LL | const BAD_ENUM2_WRAPPED: Wrap = unsafe { mem::transmute(&0) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-enum.rs:63:1 + | +LL | const BAD_ENUM2_OPTION_PTR: Option = unsafe { mem::transmute(&0) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-eval/ub-enum.64bit.stderr b/src/test/ui/consts/const-eval/ub-enum.64bit.stderr index 25be593ab83b0..e9b4023068e94 100644 --- a/src/test/ui/consts/const-eval/ub-enum.64bit.stderr +++ b/src/test/ui/consts/const-eval/ub-enum.64bit.stderr @@ -125,3 +125,58 @@ LL | const BAD_UNINHABITED_WITH_DATA2: Result<(i32, !), (i32, Never)> = unsafe { error: aborting due to 13 previous errors For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-enum.rs:26:1 + | +LL | const BAD_ENUM_PTR: Enum = unsafe { mem::transmute(&1) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-enum.rs:30:1 + | +LL | const BAD_ENUM_WRAPPED: Wrap = unsafe { mem::transmute(&1) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-enum.rs:45:1 + | +LL | const BAD_ENUM2_PTR: Enum2 = unsafe { mem::transmute(&0) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-enum.rs:49:1 + | +LL | const BAD_ENUM2_WRAPPED: Wrap = unsafe { mem::transmute(&0) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-enum.rs:63:1 + | +LL | const BAD_ENUM2_OPTION_PTR: Option = unsafe { mem::transmute(&0) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-eval/ub-ref-ptr.32bit.stderr b/src/test/ui/consts/const-eval/ub-ref-ptr.32bit.stderr index 8a4f23c033e89..10a0ccd552b6d 100644 --- a/src/test/ui/consts/const-eval/ub-ref-ptr.32bit.stderr +++ b/src/test/ui/consts/const-eval/ub-ref-ptr.32bit.stderr @@ -176,3 +176,66 @@ LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) }; error: aborting due to 16 previous errors For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-ref-ptr.rs:31:1 + | +LL | const REF_AS_USIZE: usize = unsafe { mem::transmute(&0) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-ref-ptr.rs:35:39 + | +LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }]; + | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-ref-ptr.rs:35:38 + | +LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }]; + | -------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- + | | + | referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-ref-ptr.rs:41:86 + | +LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) }; + | -------------------------------------------------------------------------------------^^^^^^^^^^^^^^^^^^^^---- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-ref-ptr.rs:41:85 + | +LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) }; + | ------------------------------------------------------------------------------------^^^^^^^^^^^^^^^^^^^^^---- + | | + | referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-eval/ub-ref-ptr.64bit.stderr b/src/test/ui/consts/const-eval/ub-ref-ptr.64bit.stderr index da1c6d1a07f84..e9fcefe12c7d9 100644 --- a/src/test/ui/consts/const-eval/ub-ref-ptr.64bit.stderr +++ b/src/test/ui/consts/const-eval/ub-ref-ptr.64bit.stderr @@ -176,3 +176,66 @@ LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) }; error: aborting due to 16 previous errors For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-ref-ptr.rs:31:1 + | +LL | const REF_AS_USIZE: usize = unsafe { mem::transmute(&0) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-ref-ptr.rs:35:39 + | +LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }]; + | --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-ref-ptr.rs:35:38 + | +LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }]; + | -------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- + | | + | referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-ref-ptr.rs:41:86 + | +LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) }; + | -------------------------------------------------------------------------------------^^^^^^^^^^^^^^^^^^^^---- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-ref-ptr.rs:41:85 + | +LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) }; + | ------------------------------------------------------------------------------------^^^^^^^^^^^^^^^^^^^^^---- + | | + | referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-eval/ub-wide-ptr.32bit.stderr b/src/test/ui/consts/const-eval/ub-wide-ptr.32bit.stderr index a78cff11589fd..0c398f5bfd45e 100644 --- a/src/test/ui/consts/const-eval/ub-wide-ptr.32bit.stderr +++ b/src/test/ui/consts/const-eval/ub-wide-ptr.32bit.stderr @@ -344,3 +344,86 @@ LL | mem::transmute::<_, &dyn Trait>((&92u8, &3u64)) error: aborting due to 32 previous errors For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-wide-ptr.rs:42:1 + | +LL | const STR_LENGTH_PTR: &str = unsafe { mem::transmute((&42u8, &3)) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-wide-ptr.rs:46:1 + | +LL | const MY_STR_LENGTH_PTR: &MyStr = unsafe { mem::transmute((&42u8, &3)) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-wide-ptr.rs:75:1 + | +LL | const SLICE_LENGTH_PTR: &[u8] = unsafe { mem::transmute((&42u8, &3)) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-wide-ptr.rs:82:1 + | +LL | const SLICE_LENGTH_PTR_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, &3)) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-wide-ptr.rs:87:40 + | +LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }]; + | ---------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- + | | + | referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-wide-ptr.rs:95:42 + | +LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]); + | -----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- + | | + | referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-wide-ptr.rs:100:42 + | +LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]); + | -----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- + | | + | referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-eval/ub-wide-ptr.64bit.stderr b/src/test/ui/consts/const-eval/ub-wide-ptr.64bit.stderr index 69a61d9caede6..bf53995d956c5 100644 --- a/src/test/ui/consts/const-eval/ub-wide-ptr.64bit.stderr +++ b/src/test/ui/consts/const-eval/ub-wide-ptr.64bit.stderr @@ -344,3 +344,86 @@ LL | mem::transmute::<_, &dyn Trait>((&92u8, &3u64)) error: aborting due to 32 previous errors For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-wide-ptr.rs:42:1 + | +LL | const STR_LENGTH_PTR: &str = unsafe { mem::transmute((&42u8, &3)) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-wide-ptr.rs:46:1 + | +LL | const MY_STR_LENGTH_PTR: &MyStr = unsafe { mem::transmute((&42u8, &3)) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-wide-ptr.rs:75:1 + | +LL | const SLICE_LENGTH_PTR: &[u8] = unsafe { mem::transmute((&42u8, &3)) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-wide-ptr.rs:82:1 + | +LL | const SLICE_LENGTH_PTR_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, &3)) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-wide-ptr.rs:87:40 + | +LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }]; + | ---------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- + | | + | referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-wide-ptr.rs:95:42 + | +LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]); + | -----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- + | | + | referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ub-wide-ptr.rs:100:42 + | +LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]); + | -----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- + | | + | referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-eval/unused-broken-const.stderr b/src/test/ui/consts/const-eval/unused-broken-const.stderr index 2ce60ec16a33f..bfc076aa5e64f 100644 --- a/src/test/ui/consts/const-eval/unused-broken-const.stderr +++ b/src/test/ui/consts/const-eval/unused-broken-const.stderr @@ -12,3 +12,16 @@ LL | const FOO: i32 = [][0]; error: aborting due to previous error +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/unused-broken-const.rs:5:18 + | +LL | const FOO: i32 = [][0]; + | -----------------^^^^^- + | | + | index out of bounds: the length is 0 but the index is 0 + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-external-macro-const-err.stderr b/src/test/ui/consts/const-external-macro-const-err.stderr index a66d79a16160c..205ee92dfd7cf 100644 --- a/src/test/ui/consts/const-external-macro-const-err.stderr +++ b/src/test/ui/consts/const-external-macro-const-err.stderr @@ -11,3 +11,15 @@ LL | static_assert!(2 + 2 == 5); error: aborting due to previous error +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-external-macro-const-err.rs:12:5 + | +LL | static_assert!(2 + 2 == 5); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ index out of bounds: the length is 1 but the index is 1 + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + = note: this error originates in the macro `static_assert` (in Nightly builds, run with -Z macro-backtrace for more info) + diff --git a/src/test/ui/consts/const-float-bits-reject-conv.stderr b/src/test/ui/consts/const-float-bits-reject-conv.stderr index f3fd098e848a2..d822171df7234 100644 --- a/src/test/ui/consts/const-float-bits-reject-conv.stderr +++ b/src/test/ui/consts/const-float-bits-reject-conv.stderr @@ -214,3 +214,115 @@ LL | const_assert!(f64::from_bits(MASKED_NAN2).to_bits(), MASKED_NAN2); error: aborting due to 12 previous errors For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-float-bits-reject-conv.rs:30:34 + | +LL | const _: () = assert!($a); + | -------------------------- +... +LL | const_assert!(f32::from_bits(MASKED_NAN1).is_nan()); + | ^^^^^^^^^^^ referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-float-bits-reject-conv.rs:33:34 + | +LL | const _: () = assert!($a); + | -------------------------- +... +LL | const_assert!(f32::from_bits(MASKED_NAN1).is_nan()); + | ^^^^^^^^^^^ referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-float-bits-reject-conv.rs:41:38 + | +LL | const _: () = assert!($a == $b); + | -------------------------------- +... +LL | const_assert!(f32::from_bits(MASKED_NAN1).to_bits(), MASKED_NAN1); + | ^^^^^^^^^^^ referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-float-bits-reject-conv.rs:44:38 + | +LL | const _: () = assert!($a == $b); + | -------------------------------- +... +LL | const_assert!(f32::from_bits(MASKED_NAN2).to_bits(), MASKED_NAN2); + | ^^^^^^^^^^^ referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-float-bits-reject-conv.rs:57:34 + | +LL | const _: () = assert!($a); + | -------------------------- +... +LL | const_assert!(f64::from_bits(MASKED_NAN1).is_nan()); + | ^^^^^^^^^^^ referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-float-bits-reject-conv.rs:60:34 + | +LL | const _: () = assert!($a); + | -------------------------- +... +LL | const_assert!(f64::from_bits(MASKED_NAN1).is_nan()); + | ^^^^^^^^^^^ referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-float-bits-reject-conv.rs:66:38 + | +LL | const _: () = assert!($a == $b); + | -------------------------------- +... +LL | const_assert!(f64::from_bits(MASKED_NAN1).to_bits(), MASKED_NAN1); + | ^^^^^^^^^^^ referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-float-bits-reject-conv.rs:69:38 + | +LL | const _: () = assert!($a == $b); + | -------------------------------- +... +LL | const_assert!(f64::from_bits(MASKED_NAN2).to_bits(), MASKED_NAN2); + | ^^^^^^^^^^^ referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-len-underflow-separate-spans.stderr b/src/test/ui/consts/const-len-underflow-separate-spans.stderr index 70f645a6c40e8..0c10783476abc 100644 --- a/src/test/ui/consts/const-len-underflow-separate-spans.stderr +++ b/src/test/ui/consts/const-len-underflow-separate-spans.stderr @@ -19,3 +19,16 @@ LL | let a: [i8; LEN] = unimplemented!(); error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-len-underflow-separate-spans.rs:7:20 + | +LL | const LEN: usize = ONE - TWO; + | -------------------^^^^^^^^^- + | | + | attempt to compute `1_usize - 2_usize`, which would overflow + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-prop-read-static-in-const.stderr b/src/test/ui/consts/const-prop-read-static-in-const.stderr index 94d3f1c614544..a60cd16f05a18 100644 --- a/src/test/ui/consts/const-prop-read-static-in-const.stderr +++ b/src/test/ui/consts/const-prop-read-static-in-const.stderr @@ -20,3 +20,16 @@ LL | const TEST: u8 = MY_STATIC; error: aborting due to previous error; 1 warning emitted +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-prop-read-static-in-const.rs:5:18 + | +LL | const TEST: u8 = MY_STATIC; + | -----------------^^^^^^^^^- + | | + | constant accesses static + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-size_of_val-align_of_val-extern-type.stderr b/src/test/ui/consts/const-size_of_val-align_of_val-extern-type.stderr index a9211c17a6bc0..c6e0b321124b1 100644 --- a/src/test/ui/consts/const-size_of_val-align_of_val-extern-type.stderr +++ b/src/test/ui/consts/const-size_of_val-align_of_val-extern-type.stderr @@ -23,3 +23,29 @@ LL | const _ALIGN: usize = unsafe { min_align_of_val(&4 as *const i32 as *const error: aborting due to 2 previous errors +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-size_of_val-align_of_val-extern-type.rs:11:31 + | +LL | const _SIZE: usize = unsafe { size_of_val(&4 as *const i32 as *const Opaque) }; + | ------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- + | | + | `extern type` does not have known layout + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-size_of_val-align_of_val-extern-type.rs:13:32 + | +LL | const _ALIGN: usize = unsafe { min_align_of_val(&4 as *const i32 as *const Opaque) }; + | -------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- + | | + | `extern type` does not have known layout + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const-slice-oob.stderr b/src/test/ui/consts/const-slice-oob.stderr index 6d2c79034d391..c9f949727bc63 100644 --- a/src/test/ui/consts/const-slice-oob.stderr +++ b/src/test/ui/consts/const-slice-oob.stderr @@ -12,3 +12,16 @@ LL | const BAR: u32 = FOO[5]; error: aborting due to previous error +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const-slice-oob.rs:4:18 + | +LL | const BAR: u32 = FOO[5]; + | -----------------^^^^^^- + | | + | index out of bounds: the length is 3 but the index is 5 + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/const_limit/const_eval_limit_reached.stderr b/src/test/ui/consts/const_limit/const_eval_limit_reached.stderr index 5e706a4466ea1..ee95b0d518050 100644 --- a/src/test/ui/consts/const_limit/const_eval_limit_reached.stderr +++ b/src/test/ui/consts/const_limit/const_eval_limit_reached.stderr @@ -17,3 +17,21 @@ LL | | }; error: aborting due to previous error +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/const_eval_limit_reached.rs:6:11 + | +LL | / const X: usize = { +LL | | let mut x = 0; +LL | | while x != 1000 { + | | ^^^^^^^^^ exceeded interpreter step limit (see `#[const_eval_limit]`) +LL | | +... | +LL | | x +LL | | }; + | |__- + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/invalid-union.32bit.stderr b/src/test/ui/consts/invalid-union.32bit.stderr index 38c38d1ae6732..bd7c95342f7f9 100644 --- a/src/test/ui/consts/invalid-union.32bit.stderr +++ b/src/test/ui/consts/invalid-union.32bit.stderr @@ -22,3 +22,14 @@ LL | let _: &'static _ = &C; error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +error: erroneous constant used + --> $DIR/invalid-union.rs:41:25 + | +LL | let _: &'static _ = &C; + | ^^ referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/invalid-union.64bit.stderr b/src/test/ui/consts/invalid-union.64bit.stderr index 6bfa97a2fded7..0d8b8ffcc161b 100644 --- a/src/test/ui/consts/invalid-union.64bit.stderr +++ b/src/test/ui/consts/invalid-union.64bit.stderr @@ -22,3 +22,14 @@ LL | let _: &'static _ = &C; error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +error: erroneous constant used + --> $DIR/invalid-union.rs:41:25 + | +LL | let _: &'static _ = &C; + | ^^ referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/issue-56164.stderr b/src/test/ui/consts/issue-56164.stderr index 3b80b3486a822..73a0f8ec0d04f 100644 --- a/src/test/ui/consts/issue-56164.stderr +++ b/src/test/ui/consts/issue-56164.stderr @@ -26,3 +26,14 @@ LL | const fn foo() { (||{})() } error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0015`. +Future incompatibility report: Future breakage diagnostic: +error: erroneous constant used + --> $DIR/issue-56164.rs:1:18 + | +LL | const fn foo() { (||{})() } + | ^^^^^^ referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/issue-66693.stderr b/src/test/ui/consts/issue-66693.stderr index b825768498386..929f905ae918b 100644 --- a/src/test/ui/consts/issue-66693.stderr +++ b/src/test/ui/consts/issue-66693.stderr @@ -34,3 +34,14 @@ LL | panic!(&1); error: aborting due to 4 previous errors +Future incompatibility report: Future breakage diagnostic: +error: erroneous constant used + --> $DIR/issue-66693.rs:11:12 + | +LL | panic!(&1); + | ^^ referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/issue-miri-1910.stderr b/src/test/ui/consts/issue-miri-1910.stderr index 87882449c7342..e76a1f96b46a5 100644 --- a/src/test/ui/consts/issue-miri-1910.stderr +++ b/src/test/ui/consts/issue-miri-1910.stderr @@ -24,3 +24,28 @@ LL | | }; error: aborting due to previous error +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL + | +LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | unable to turn pointer into raw bytes + | inside `std::ptr::read::` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL + | inside `ptr::const_ptr::::read` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + | inside `C` at $DIR/issue-miri-1910.rs:7:5 + | + ::: $DIR/issue-miri-1910.rs:4:1 + | +LL | / const C: () = unsafe { +LL | | let foo = Some(&42 as *const i32); +LL | | let one_and_a_half_pointers = std::mem::size_of::<*const i32>()/2*3; +LL | | (&foo as *const _ as *const u8).add(one_and_a_half_pointers).read(); +LL | | }; + | |__- + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/miri_unleashed/assoc_const.stderr b/src/test/ui/consts/miri_unleashed/assoc_const.stderr index 193a49bb2666f..1765c9ed10a30 100644 --- a/src/test/ui/consts/miri_unleashed/assoc_const.stderr +++ b/src/test/ui/consts/miri_unleashed/assoc_const.stderr @@ -15,3 +15,28 @@ LL | const F: u32 = (U::X, 42).1; error: aborting due to previous error; 1 warning emitted For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +warning: any use of this value will cause an error + --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL + | +LL | pub unsafe fn drop_in_place(to_drop: *mut T) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | calling non-const function ` as Drop>::drop` + | inside `std::ptr::drop_in_place::> - shim(Some(Vec))` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL + | inside `std::ptr::drop_in_place::<(Vec, u32)> - shim(Some((Vec, u32)))` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL + | inside `, String>>::F` at $DIR/assoc_const.rs:14:31 + | + ::: $DIR/assoc_const.rs:14:5 + | +LL | const F: u32 = (U::X, 42).1; + | ---------------------------- + | +note: the lint level is defined here + --> $DIR/assoc_const.rs:4:10 + | +LL | #![allow(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/miri_unleashed/assoc_const_2.stderr b/src/test/ui/consts/miri_unleashed/assoc_const_2.stderr index e15717979c5cb..f7be42de03fd6 100644 --- a/src/test/ui/consts/miri_unleashed/assoc_const_2.stderr +++ b/src/test/ui/consts/miri_unleashed/assoc_const_2.stderr @@ -7,3 +7,20 @@ LL | let y = >::F; error: aborting due to previous error For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/assoc_const_2.rs:12:20 + | +LL | const F: u32 = 100 / U::X; + | ---------------^^^^^^^^^^- + | | + | attempt to divide `100_u32` by zero + | +note: the lint level is defined here + --> $DIR/assoc_const_2.rs:3:10 + | +LL | #![allow(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/miri_unleashed/const_refers_to_static.stderr b/src/test/ui/consts/miri_unleashed/const_refers_to_static.stderr index c48f59fe84890..98d4dff648a5f 100644 --- a/src/test/ui/consts/miri_unleashed/const_refers_to_static.stderr +++ b/src/test/ui/consts/miri_unleashed/const_refers_to_static.stderr @@ -47,3 +47,58 @@ LL | const READ_MUT: u32 = unsafe { MUTABLE }; error: aborting due to 3 previous errors; 1 warning emitted For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/const_refers_to_static.rs:13:5 + | +LL | / const MUTATE_INTERIOR_MUT: usize = { +LL | | static FOO: AtomicUsize = AtomicUsize::new(0); +LL | | FOO.fetch_add(1, Ordering::Relaxed) + | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ calling non-const function `AtomicUsize::fetch_add` +LL | | }; + | |__- + | +note: the lint level is defined here + --> $DIR/const_refers_to_static.rs:3:10 + | +LL | #![allow(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/const_refers_to_static.rs:18:14 + | +LL | / const READ_INTERIOR_MUT: usize = { +LL | | static FOO: AtomicUsize = AtomicUsize::new(0); +LL | | unsafe { *(&FOO as *const _ as *const usize) } + | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static +LL | | }; + | |__- + | +note: the lint level is defined here + --> $DIR/const_refers_to_static.rs:3:10 + | +LL | #![allow(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/const_refers_to_static.rs:22:32 + | +LL | const READ_MUT: u32 = unsafe { MUTABLE }; + | -------------------------------^^^^^^^--- + | | + | constant accesses static + | +note: the lint level is defined here + --> $DIR/const_refers_to_static.rs:3:10 + | +LL | #![allow(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr b/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr index 186c5b1856baa..2a0766294d3e0 100644 --- a/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr +++ b/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr @@ -170,3 +170,45 @@ LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => error: aborting due to 10 previous errors; 3 warnings emitted For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/const_refers_to_static_cross_crate.rs:25:15 + | +LL | / const U8_MUT2: &u8 = { +LL | | unsafe { &(*static_cross_crate::ZERO_REF)[0] } + | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static +LL | | +LL | | +LL | | +LL | | }; + | |__- + | +note: the lint level is defined here + --> $DIR/const_refers_to_static_cross_crate.rs:23:8 + | +LL | #[warn(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/const_refers_to_static_cross_crate.rs:32:20 + | +LL | / const U8_MUT3: &u8 = { +LL | | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } } + | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static +LL | | +LL | | +LL | | +LL | | }; + | |__- + | +note: the lint level is defined here + --> $DIR/const_refers_to_static_cross_crate.rs:30:8 + | +LL | #[warn(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr b/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr index 7a64abd7b9cb8..2d4f038d91490 100644 --- a/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr +++ b/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr @@ -170,3 +170,45 @@ LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => error: aborting due to 10 previous errors; 3 warnings emitted For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/const_refers_to_static_cross_crate.rs:25:15 + | +LL | / const U8_MUT2: &u8 = { +LL | | unsafe { &(*static_cross_crate::ZERO_REF)[0] } + | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static +LL | | +LL | | +LL | | +LL | | }; + | |__- + | +note: the lint level is defined here + --> $DIR/const_refers_to_static_cross_crate.rs:23:8 + | +LL | #[warn(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/const_refers_to_static_cross_crate.rs:32:20 + | +LL | / const U8_MUT3: &u8 = { +LL | | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } } + | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static +LL | | +LL | | +LL | | +LL | | }; + | |__- + | +note: the lint level is defined here + --> $DIR/const_refers_to_static_cross_crate.rs:30:8 + | +LL | #[warn(const_err)] + | ^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/ptr_comparisons.stderr b/src/test/ui/consts/ptr_comparisons.stderr index 12f6ca0b51a53..594576fe2cf3d 100644 --- a/src/test/ui/consts/ptr_comparisons.stderr +++ b/src/test/ui/consts/ptr_comparisons.stderr @@ -44,3 +44,29 @@ LL | const _: usize = unsafe { *std::mem::transmute::<&&usize, &usize>(&FOO) + 4 error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ptr_comparisons.rs:65:27 + | +LL | const _: usize = unsafe { std::mem::transmute::<*const usize, usize>(FOO) + 4 }; + | --------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/ptr_comparisons.rs:70:27 + | +LL | const _: usize = unsafe { *std::mem::transmute::<&&usize, &usize>(&FOO) + 4 }; + | --------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^------- + | | + | unable to turn pointer into raw bytes + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/recursive.stderr b/src/test/ui/consts/recursive.stderr index 31ac1fff4e84e..8d1e10d4176ff 100644 --- a/src/test/ui/consts/recursive.stderr +++ b/src/test/ui/consts/recursive.stderr @@ -29,3 +29,22 @@ LL | const X: () = f(1); error: aborting due to previous error; 1 warning emitted +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/recursive.rs:4:5 + | +LL | f(x); + | ^^^^ + | | + | reached the configured maximum number of stack frames + | inside `f::` at $DIR/recursive.rs:4:5 + | [... 126 additional calls inside `f::` at $DIR/recursive.rs:4:5 ...] + | inside `X` at $DIR/recursive.rs:9:15 +... +LL | const X: () = f(1); + | ------------------- + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/consts/uninhabited-const-issue-61744.stderr b/src/test/ui/consts/uninhabited-const-issue-61744.stderr index e98eefc11c3c8..17dd6131436c3 100644 --- a/src/test/ui/consts/uninhabited-const-issue-61744.stderr +++ b/src/test/ui/consts/uninhabited-const-issue-61744.stderr @@ -150,3 +150,147 @@ LL | dbg!(i32::CONSTANT); error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +error: any use of this value will cause an error + --> $DIR/uninhabited-const-issue-61744.rs:4:5 + | +LL | hint_unreachable() + | ^^^^^^^^^^^^^^^^^^ + | | + | reached the configured maximum number of stack frames + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `hint_unreachable` at $DIR/uninhabited-const-issue-61744.rs:9:5 + | inside `fake_type::` at $DIR/uninhabited-const-issue-61744.rs:4:5 + | inside `::CONSTANT` at $DIR/uninhabited-const-issue-61744.rs:13:36 +... +LL | const CONSTANT: i32 = unsafe { fake_type() }; + | --------------------------------------------- + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/limits/issue-55878.stderr b/src/test/ui/limits/issue-55878.stderr index 90411353f0825..1402d1387037e 100644 --- a/src/test/ui/limits/issue-55878.stderr +++ b/src/test/ui/limits/issue-55878.stderr @@ -23,3 +23,15 @@ LL | println!("Size: {}", std::mem::size_of::<[u8; u64::MAX as usize]>()); error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0080`. +Future incompatibility report: Future breakage diagnostic: +error: erroneous constant used + --> $DIR/issue-55878.rs:7:26 + | +LL | println!("Size: {}", std::mem::size_of::<[u8; u64::MAX as usize]>()); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + = note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info) + diff --git a/src/test/ui/lint/force-warn/allowed-cli-deny-by-default-lint.stderr b/src/test/ui/lint/force-warn/allowed-cli-deny-by-default-lint.stderr index af6308f0d1b4f..c14529a7d090a 100644 --- a/src/test/ui/lint/force-warn/allowed-cli-deny-by-default-lint.stderr +++ b/src/test/ui/lint/force-warn/allowed-cli-deny-by-default-lint.stderr @@ -12,3 +12,16 @@ LL | const C: i32 = 1 / 0; warning: 1 warning emitted +Future incompatibility report: Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/allowed-cli-deny-by-default-lint.rs:6:16 + | +LL | const C: i32 = 1 / 0; + | ---------------^^^^^- + | | + | attempt to divide `1_i32` by zero + | + = note: requested on the command line with `--force-warn const-err` + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/lint/force-warn/allowed-deny-by-default-lint.stderr b/src/test/ui/lint/force-warn/allowed-deny-by-default-lint.stderr index 05656afd22d88..dd71a168960ab 100644 --- a/src/test/ui/lint/force-warn/allowed-deny-by-default-lint.stderr +++ b/src/test/ui/lint/force-warn/allowed-deny-by-default-lint.stderr @@ -12,3 +12,16 @@ LL | const C: i32 = 1 / 0; warning: 1 warning emitted +Future incompatibility report: Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/allowed-deny-by-default-lint.rs:7:16 + | +LL | const C: i32 = 1 / 0; + | ---------------^^^^^- + | | + | attempt to divide `1_i32` by zero + | + = note: requested on the command line with `--force-warn const-err` + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + diff --git a/src/test/ui/lint/force-warn/deny-by-default-lint.stderr b/src/test/ui/lint/force-warn/deny-by-default-lint.stderr index ef295f99e649c..d4e80584669ae 100644 --- a/src/test/ui/lint/force-warn/deny-by-default-lint.stderr +++ b/src/test/ui/lint/force-warn/deny-by-default-lint.stderr @@ -12,3 +12,16 @@ LL | const C: i32 = 1 / 0; warning: 1 warning emitted +Future incompatibility report: Future breakage diagnostic: +warning: any use of this value will cause an error + --> $DIR/deny-by-default-lint.rs:5:16 + | +LL | const C: i32 = 1 / 0; + | ---------------^^^^^- + | | + | attempt to divide `1_i32` by zero + | + = note: requested on the command line with `--force-warn const-err` + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 +