From 631cd5845e8de329d0e227aaa707d7ea228b8f8f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:20:29 +0200 Subject: Merging upstream version 1.70.0+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/consts/miri_unleashed/assoc_const.stderr | 6 ---- .../ui/consts/miri_unleashed/assoc_const_2.stderr | 6 ---- tests/ui/consts/miri_unleashed/box.rs | 5 ++-- tests/ui/consts/miri_unleashed/box.stderr | 29 ++++++++------------ ...const_refers_to_static_cross_crate.32bit.stderr | 32 +++------------------- ...const_refers_to_static_cross_crate.64bit.stderr | 32 +++------------------- .../const_refers_to_static_cross_crate.rs | 4 --- tests/ui/consts/miri_unleashed/tls.stderr | 4 +-- 8 files changed, 24 insertions(+), 94 deletions(-) (limited to 'tests/ui/consts/miri_unleashed') diff --git a/tests/ui/consts/miri_unleashed/assoc_const.stderr b/tests/ui/consts/miri_unleashed/assoc_const.stderr index e1da43c3a..8e22cb74b 100644 --- a/tests/ui/consts/miri_unleashed/assoc_const.stderr +++ b/tests/ui/consts/miri_unleashed/assoc_const.stderr @@ -25,12 +25,6 @@ note: erroneous constant used LL | let y = , String>>::F; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: erroneous constant used - --> $DIR/assoc_const.rs:29:13 - | -LL | let y = , String>>::F; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - warning: skipping const checks | help: skipping check that does not even have a feature gate diff --git a/tests/ui/consts/miri_unleashed/assoc_const_2.stderr b/tests/ui/consts/miri_unleashed/assoc_const_2.stderr index fc4b18056..ae7b03fc9 100644 --- a/tests/ui/consts/miri_unleashed/assoc_const_2.stderr +++ b/tests/ui/consts/miri_unleashed/assoc_const_2.stderr @@ -16,12 +16,6 @@ note: erroneous constant used LL | let y = >::F; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: erroneous constant used - --> $DIR/assoc_const_2.rs:27:13 - | -LL | let y = >::F; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - error: aborting due to previous error For more information about this error, try `rustc --explain E0080`. diff --git a/tests/ui/consts/miri_unleashed/box.rs b/tests/ui/consts/miri_unleashed/box.rs index c2a260aa1..39cddda2b 100644 --- a/tests/ui/consts/miri_unleashed/box.rs +++ b/tests/ui/consts/miri_unleashed/box.rs @@ -1,12 +1,11 @@ // compile-flags: -Zunleash-the-miri-inside-of-you -#![feature(box_syntax)] use std::mem::ManuallyDrop; fn main() {} static TEST_BAD: &mut i32 = { - &mut *(box 0) + &mut *(Box::new(0)) //~^ ERROR could not evaluate static initializer - //~| NOTE calling non-const function `alloc::alloc::exchange_malloc` + //~| NOTE calling non-const function `Box::::new` }; diff --git a/tests/ui/consts/miri_unleashed/box.stderr b/tests/ui/consts/miri_unleashed/box.stderr index bc5d4a257..407f5d8cb 100644 --- a/tests/ui/consts/miri_unleashed/box.stderr +++ b/tests/ui/consts/miri_unleashed/box.stderr @@ -1,31 +1,26 @@ error[E0080]: could not evaluate static initializer - --> $DIR/box.rs:9:11 + --> $DIR/box.rs:8:11 | -LL | &mut *(box 0) - | ^^^^^^^ calling non-const function `alloc::alloc::exchange_malloc` +LL | &mut *(Box::new(0)) + | ^^^^^^^^^^^^^ calling non-const function `Box::::new` warning: skipping const checks | help: skipping check that does not even have a feature gate - --> $DIR/box.rs:9:11 + --> $DIR/box.rs:8:11 | -LL | &mut *(box 0) - | ^^^^^^^ +LL | &mut *(Box::new(0)) + | ^^^^^^^^^^^^^ help: skipping check for `const_mut_refs` feature - --> $DIR/box.rs:9:16 + --> $DIR/box.rs:8:5 | -LL | &mut *(box 0) - | ^ -help: skipping check for `const_mut_refs` feature - --> $DIR/box.rs:9:5 - | -LL | &mut *(box 0) - | ^^^^^^^^^^^^^ +LL | &mut *(Box::new(0)) + | ^^^^^^^^^^^^^^^^^^^ help: skipping check that does not even have a feature gate - --> $DIR/box.rs:9:5 + --> $DIR/box.rs:8:5 | -LL | &mut *(box 0) - | ^^^^^^^^^^^^^ +LL | &mut *(Box::new(0)) + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error; 1 warning emitted diff --git a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr index 6df2fe3d0..e3a0d93f0 100644 --- a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr +++ b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.32bit.stderr @@ -27,7 +27,7 @@ LL | const U8_MUT: &u8 = { } error: could not evaluate constant pattern - --> $DIR/const_refers_to_static_cross_crate.rs:43:9 + --> $DIR/const_refers_to_static_cross_crate.rs:42:9 | LL | U8_MUT => true, | ^^^^^^ @@ -39,7 +39,7 @@ LL | unsafe { &(*static_cross_crate::ZERO_REF)[0] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static error: could not evaluate constant pattern - --> $DIR/const_refers_to_static_cross_crate.rs:54:9 + --> $DIR/const_refers_to_static_cross_crate.rs:52:9 | LL | U8_MUT2 => true, | ^^^^^^^ @@ -51,31 +51,7 @@ LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static error: could not evaluate constant pattern - --> $DIR/const_refers_to_static_cross_crate.rs:62:9 - | -LL | U8_MUT3 => true, - | ^^^^^^^ - -error: could not evaluate constant pattern - --> $DIR/const_refers_to_static_cross_crate.rs:34:9 - | -LL | SLICE_MUT => true, - | ^^^^^^^^^ - -error: could not evaluate constant pattern - --> $DIR/const_refers_to_static_cross_crate.rs:43:9 - | -LL | U8_MUT => true, - | ^^^^^^ - -error: could not evaluate constant pattern - --> $DIR/const_refers_to_static_cross_crate.rs:54:9 - | -LL | U8_MUT2 => true, - | ^^^^^^^ - -error: could not evaluate constant pattern - --> $DIR/const_refers_to_static_cross_crate.rs:62:9 + --> $DIR/const_refers_to_static_cross_crate.rs:59:9 | LL | U8_MUT3 => true, | ^^^^^^^ @@ -133,6 +109,6 @@ help: skipping check that does not even have a feature gate LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 12 previous errors; 1 warning emitted +error: aborting due to 8 previous errors; 1 warning emitted For more information about this error, try `rustc --explain E0080`. diff --git a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr index 8802f3ada..a323e9a05 100644 --- a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr +++ b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.64bit.stderr @@ -27,7 +27,7 @@ LL | const U8_MUT: &u8 = { } error: could not evaluate constant pattern - --> $DIR/const_refers_to_static_cross_crate.rs:43:9 + --> $DIR/const_refers_to_static_cross_crate.rs:42:9 | LL | U8_MUT => true, | ^^^^^^ @@ -39,7 +39,7 @@ LL | unsafe { &(*static_cross_crate::ZERO_REF)[0] } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static error: could not evaluate constant pattern - --> $DIR/const_refers_to_static_cross_crate.rs:54:9 + --> $DIR/const_refers_to_static_cross_crate.rs:52:9 | LL | U8_MUT2 => true, | ^^^^^^^ @@ -51,31 +51,7 @@ LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses static error: could not evaluate constant pattern - --> $DIR/const_refers_to_static_cross_crate.rs:62:9 - | -LL | U8_MUT3 => true, - | ^^^^^^^ - -error: could not evaluate constant pattern - --> $DIR/const_refers_to_static_cross_crate.rs:34:9 - | -LL | SLICE_MUT => true, - | ^^^^^^^^^ - -error: could not evaluate constant pattern - --> $DIR/const_refers_to_static_cross_crate.rs:43:9 - | -LL | U8_MUT => true, - | ^^^^^^ - -error: could not evaluate constant pattern - --> $DIR/const_refers_to_static_cross_crate.rs:54:9 - | -LL | U8_MUT2 => true, - | ^^^^^^^ - -error: could not evaluate constant pattern - --> $DIR/const_refers_to_static_cross_crate.rs:62:9 + --> $DIR/const_refers_to_static_cross_crate.rs:59:9 | LL | U8_MUT3 => true, | ^^^^^^^ @@ -133,6 +109,6 @@ help: skipping check that does not even have a feature gate LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 12 previous errors; 1 warning emitted +error: aborting due to 8 previous errors; 1 warning emitted For more information about this error, try `rustc --explain E0080`. diff --git a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs index bf4f14f4d..bbaa32ddf 100644 --- a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs +++ b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs @@ -33,7 +33,6 @@ pub fn test(x: &[u8; 1]) -> bool { match x { SLICE_MUT => true, //~^ ERROR could not evaluate constant pattern - //~| ERROR could not evaluate constant pattern &[1..] => false, } } @@ -42,7 +41,6 @@ pub fn test2(x: &u8) -> bool { match x { U8_MUT => true, //~^ ERROR could not evaluate constant pattern - //~| ERROR could not evaluate constant pattern &(1..) => false, } } @@ -53,7 +51,6 @@ pub fn test3(x: &u8) -> bool { match x { U8_MUT2 => true, //~^ ERROR could not evaluate constant pattern - //~| ERROR could not evaluate constant pattern &(1..) => false, } } @@ -61,7 +58,6 @@ pub fn test4(x: &u8) -> bool { match x { U8_MUT3 => true, //~^ ERROR could not evaluate constant pattern - //~| ERROR could not evaluate constant pattern &(1..) => false, } } diff --git a/tests/ui/consts/miri_unleashed/tls.stderr b/tests/ui/consts/miri_unleashed/tls.stderr index 7aaeadd04..ec24527d6 100644 --- a/tests/ui/consts/miri_unleashed/tls.stderr +++ b/tests/ui/consts/miri_unleashed/tls.stderr @@ -2,13 +2,13 @@ error[E0080]: could not evaluate static initializer --> $DIR/tls.rs:11:25 | LL | unsafe { let _val = A; } - | ^ cannot access thread local static (DefId(0:4 ~ tls[78b0]::A)) + | ^ cannot access thread local static (DefId(0:4 ~ tls[ca29]::A)) error[E0080]: could not evaluate static initializer --> $DIR/tls.rs:18:26 | LL | unsafe { let _val = &A; } - | ^ cannot access thread local static (DefId(0:4 ~ tls[78b0]::A)) + | ^ cannot access thread local static (DefId(0:4 ~ tls[ca29]::A)) warning: skipping const checks | -- cgit v1.2.3