diff --git a/src/test/ui/const_evaluatable/function-call.rs b/src/test/ui/const_evaluatable/function-call.rs index 9b54a541e6906..b5de66621c50e 100644 --- a/src/test/ui/const_evaluatable/function-call.rs +++ b/src/test/ui/const_evaluatable/function-call.rs @@ -1,8 +1,9 @@ // check-pass -#![warn(const_evaluatable_unchecked)] const fn foo() -> usize { - if std::mem::size_of::<*mut T>() < 8 { // size of *mut T does not depend on T + // We might instead branch on `std::mem::size_of::<*mut T>() < 8` here, + // which would cause this function to fail on 32 bit systems. + if false { std::mem::size_of::() } else { 8 diff --git a/src/test/ui/const_evaluatable/function-call.stderr b/src/test/ui/const_evaluatable/function-call.stderr index a63a2643ad2c2..0d8463714e8df 100644 --- a/src/test/ui/const_evaluatable/function-call.stderr +++ b/src/test/ui/const_evaluatable/function-call.stderr @@ -1,14 +1,10 @@ warning: cannot use constants which depend on generic parameters in types - --> $DIR/function-call.rs:13:17 + --> $DIR/function-call.rs:14:17 | LL | let _ = [0; foo::()]; | ^^^^^^^^^^ | -note: the lint level is defined here - --> $DIR/function-call.rs:2:9 - | -LL | #![warn(const_evaluatable_unchecked)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: `#[warn(const_evaluatable_unchecked)]` 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 #76200