diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2022-01-19 16:24:49 +0100 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-03-03 18:50:28 +0100 |
| commit | 27d8cd7db046746bbfbb0bd3e1df40757cabb1fe (patch) | |
| tree | 73d8e9794fdf393e901f858007657eb14e99a7d0 /src/test/ui/consts | |
| parent | 3c7947ee43b14f124b41f5de7c247dc8e47a18fa (diff) | |
| download | rust-27d8cd7db046746bbfbb0bd3e1df40757cabb1fe.tar.gz rust-27d8cd7db046746bbfbb0bd3e1df40757cabb1fe.zip | |
Cleanup feature gates.
Diffstat (limited to 'src/test/ui/consts')
17 files changed, 17 insertions, 26 deletions
diff --git a/src/test/ui/consts/const-array-oob-arith.rs b/src/test/ui/consts/const-array-oob-arith.rs index 2f5661e32a9..9332cbbd4d7 100644 --- a/src/test/ui/consts/const-array-oob-arith.rs +++ b/src/test/ui/consts/const-array-oob-arith.rs @@ -1,5 +1,3 @@ -#![feature(const_indexing)] - const ARR: [i32; 6] = [42, 43, 44, 45, 46, 47]; const IDX: usize = 3; const VAL: i32 = ARR[IDX]; diff --git a/src/test/ui/consts/const-array-oob-arith.stderr b/src/test/ui/consts/const-array-oob-arith.stderr index eae93b72ddc..f7a55d3ca72 100644 --- a/src/test/ui/consts/const-array-oob-arith.stderr +++ b/src/test/ui/consts/const-array-oob-arith.stderr @@ -1,11 +1,11 @@ error[E0308]: mismatched types - --> $DIR/const-array-oob-arith.rs:7:45 + --> $DIR/const-array-oob-arith.rs:5:45 | LL | const BLUB: [i32; (ARR[0] - 40) as usize] = [5]; | ^^^ expected an array with a fixed size of 2 elements, found one with 1 element error[E0308]: mismatched types - --> $DIR/const-array-oob-arith.rs:10:44 + --> $DIR/const-array-oob-arith.rs:8:44 | LL | const BOO: [i32; (ARR[0] - 41) as usize] = [5, 99]; | ^^^^^^^ expected an array with a fixed size of 1 element, found one with 2 elements diff --git a/src/test/ui/consts/const-array-oob.rs b/src/test/ui/consts/const-array-oob.rs index eca2fe18ab9..c747ab50c16 100644 --- a/src/test/ui/consts/const-array-oob.rs +++ b/src/test/ui/consts/const-array-oob.rs @@ -1,5 +1,3 @@ -#![feature(const_indexing)] - const FOO: [usize; 3] = [1, 2, 3]; const BAR: usize = FOO[5]; // no error, because the error below occurs before regular const eval diff --git a/src/test/ui/consts/const-array-oob.stderr b/src/test/ui/consts/const-array-oob.stderr index 1aa3e88e520..f1c5f58af47 100644 --- a/src/test/ui/consts/const-array-oob.stderr +++ b/src/test/ui/consts/const-array-oob.stderr @@ -1,5 +1,5 @@ error[E0080]: evaluation of constant value failed - --> $DIR/const-array-oob.rs:6:19 + --> $DIR/const-array-oob.rs:4:19 | LL | const BLUB: [u32; FOO[4]] = [5, 6]; | ^^^^^^ index out of bounds: the length is 3 but the index is 4 diff --git a/src/test/ui/consts/const-eval/transmute-const-promotion.rs b/src/test/ui/consts/const-eval/transmute-const-promotion.rs index 8bd1b341e6e..1f0240d4b5a 100644 --- a/src/test/ui/consts/const-eval/transmute-const-promotion.rs +++ b/src/test/ui/consts/const-eval/transmute-const-promotion.rs @@ -1,5 +1,3 @@ -#![feature(const_transmute)] - use std::mem; fn main() { diff --git a/src/test/ui/consts/const-eval/transmute-const-promotion.stderr b/src/test/ui/consts/const-eval/transmute-const-promotion.stderr index 5aae8c12d16..15b9b56ea66 100644 --- a/src/test/ui/consts/const-eval/transmute-const-promotion.stderr +++ b/src/test/ui/consts/const-eval/transmute-const-promotion.stderr @@ -1,5 +1,5 @@ error[E0716]: temporary value dropped while borrowed - --> $DIR/transmute-const-promotion.rs:6:37 + --> $DIR/transmute-const-promotion.rs:4:37 | LL | let x: &'static u32 = unsafe { &mem::transmute(3.0f32) }; | ------------ ^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use diff --git a/src/test/ui/consts/issue-87046.rs b/src/test/ui/consts/issue-87046.rs index 1f147439f8b..4b8f9f53641 100644 --- a/src/test/ui/consts/issue-87046.rs +++ b/src/test/ui/consts/issue-87046.rs @@ -2,7 +2,6 @@ #![crate_type="lib"] #![allow(unreachable_patterns)] -#![feature(const_fn_union)] #[derive(PartialEq, Eq)] #[repr(transparent)] diff --git a/src/test/ui/consts/issue-87046.stderr b/src/test/ui/consts/issue-87046.stderr index 5da7a9e2390..d0dbb21cee0 100644 --- a/src/test/ui/consts/issue-87046.stderr +++ b/src/test/ui/consts/issue-87046.stderr @@ -1,5 +1,5 @@ error: cannot use unsized non-slice type `Username` in constant patterns - --> $DIR/issue-87046.rs:29:13 + --> $DIR/issue-87046.rs:28:13 | LL | ROOT_USER => true, | ^^^^^^^^^ diff --git a/src/test/ui/consts/min_const_fn/allow_const_fn_ptr.rs b/src/test/ui/consts/min_const_fn/allow_const_fn_ptr.rs index 53ade85bfd2..a0870ea6de3 100644 --- a/src/test/ui/consts/min_const_fn/allow_const_fn_ptr.rs +++ b/src/test/ui/consts/min_const_fn/allow_const_fn_ptr.rs @@ -1,5 +1,6 @@ #![feature(rustc_attrs, staged_api, rustc_allow_const_fn_unstable)] #![feature(const_fn_fn_ptr_basics)] +#![stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_stable(since="1.0.0", feature = "mep")] diff --git a/src/test/ui/consts/min_const_fn/allow_const_fn_ptr.stderr b/src/test/ui/consts/min_const_fn/allow_const_fn_ptr.stderr index 6f89225719f..3523cab49fd 100644 --- a/src/test/ui/consts/min_const_fn/allow_const_fn_ptr.stderr +++ b/src/test/ui/consts/min_const_fn/allow_const_fn_ptr.stderr @@ -1,5 +1,5 @@ error: const-stable function cannot use `#[feature(const_fn_fn_ptr_basics)]` - --> $DIR/allow_const_fn_ptr.rs:6:16 + --> $DIR/allow_const_fn_ptr.rs:7:16 | LL | const fn error(_: fn()) {} | ^ diff --git a/src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.rs b/src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.rs index 35aa587d3d2..bb240fb4ad6 100644 --- a/src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.rs +++ b/src/test/ui/consts/min_const_fn/min_const_fn_libstd_stability.rs @@ -15,7 +15,7 @@ const fn foo() -> u32 { 42 } // can't call non-min_const_fn const fn bar() -> u32 { foo() } //~ ERROR not yet stable as a const fn -#[unstable(feature = "rust1", issue = "none")] +#[unstable(feature = "foo2", issue = "none")] const fn foo2() -> u32 { 42 } #[stable(feature = "rust1", since = "1.0.0")] diff --git a/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.rs b/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.rs index 962a57bb8e9..03084c8674d 100644 --- a/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.rs +++ b/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability.rs @@ -15,7 +15,7 @@ const unsafe fn foo() -> u32 { 42 } // can't call non-min_const_fn const unsafe fn bar() -> u32 { unsafe { foo() } } //~ ERROR not yet stable as a const fn -#[unstable(feature = "rust1", issue = "none")] +#[unstable(feature = "foo2", issue = "none")] const unsafe fn foo2() -> u32 { 42 } #[stable(feature = "rust1", since = "1.0.0")] diff --git a/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.rs b/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.rs index 194f5fc1e54..94b62071362 100644 --- a/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.rs +++ b/src/test/ui/consts/min_const_fn/min_const_unsafe_fn_libstd_stability2.rs @@ -15,7 +15,7 @@ const fn foo() -> u32 { 42 } // can't call non-min_const_fn const unsafe fn bar() -> u32 { foo() } //~ ERROR not yet stable as a const fn -#[unstable(feature = "rust1", issue = "none")] +#[unstable(feature = "foo2", issue = "none")] const fn foo2() -> u32 { 42 } #[stable(feature = "rust1", since = "1.0.0")] diff --git a/src/test/ui/consts/transmute-size-mismatch-before-typeck.rs b/src/test/ui/consts/transmute-size-mismatch-before-typeck.rs index 0f0068ac3bd..2e1d5d26b5c 100644 --- a/src/test/ui/consts/transmute-size-mismatch-before-typeck.rs +++ b/src/test/ui/consts/transmute-size-mismatch-before-typeck.rs @@ -1,5 +1,3 @@ -#![feature(const_transmute)] - // normalize-stderr-64bit "64 bits" -> "word size" // normalize-stderr-32bit "32 bits" -> "word size" // normalize-stderr-64bit "128 bits" -> "2 * word size" diff --git a/src/test/ui/consts/transmute-size-mismatch-before-typeck.stderr b/src/test/ui/consts/transmute-size-mismatch-before-typeck.stderr index 6e93aed70b6..27cc2f5e66a 100644 --- a/src/test/ui/consts/transmute-size-mismatch-before-typeck.stderr +++ b/src/test/ui/consts/transmute-size-mismatch-before-typeck.stderr @@ -1,5 +1,5 @@ error: any use of this value will cause an error - --> $DIR/transmute-size-mismatch-before-typeck.rs:15:29 + --> $DIR/transmute-size-mismatch-before-typeck.rs:13:29 | LL | const ZST: &[u8] = unsafe { std::mem::transmute(1usize) }; | ----------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^--- @@ -11,13 +11,13 @@ LL | const ZST: &[u8] = unsafe { std::mem::transmute(1usize) }; = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800> error: could not evaluate constant pattern - --> $DIR/transmute-size-mismatch-before-typeck.rs:10:9 + --> $DIR/transmute-size-mismatch-before-typeck.rs:8:9 | LL | ZST => {} | ^^^ error[E0512]: cannot transmute between types of different sizes, or dependently-sized types - --> $DIR/transmute-size-mismatch-before-typeck.rs:15:29 + --> $DIR/transmute-size-mismatch-before-typeck.rs:13:29 | LL | const ZST: &[u8] = unsafe { std::mem::transmute(1usize) }; | ^^^^^^^^^^^^^^^^^^^ @@ -26,7 +26,7 @@ LL | const ZST: &[u8] = unsafe { std::mem::transmute(1usize) }; = note: target type: `&[u8]` (2 * word size) error: could not evaluate constant pattern - --> $DIR/transmute-size-mismatch-before-typeck.rs:10:9 + --> $DIR/transmute-size-mismatch-before-typeck.rs:8:9 | LL | ZST => {} | ^^^ diff --git a/src/test/ui/consts/unstable-const-fn-in-libcore.rs b/src/test/ui/consts/unstable-const-fn-in-libcore.rs index 2fbbbbffac4..8ee1270805e 100644 --- a/src/test/ui/consts/unstable-const-fn-in-libcore.rs +++ b/src/test/ui/consts/unstable-const-fn-in-libcore.rs @@ -4,7 +4,6 @@ // gate was not enabled in libcore. #![stable(feature = "core", since = "1.6.0")] -#![feature(rustc_const_unstable)] #![feature(staged_api)] #![feature(const_fn_trait_bound)] diff --git a/src/test/ui/consts/unstable-const-fn-in-libcore.stderr b/src/test/ui/consts/unstable-const-fn-in-libcore.stderr index 4ef25bd1334..3ec9971b8e1 100644 --- a/src/test/ui/consts/unstable-const-fn-in-libcore.stderr +++ b/src/test/ui/consts/unstable-const-fn-in-libcore.stderr @@ -1,5 +1,5 @@ error[E0015]: cannot call non-const closure in constant functions - --> $DIR/unstable-const-fn-in-libcore.rs:24:26 + --> $DIR/unstable-const-fn-in-libcore.rs:23:26 | LL | Opt::None => f(), | ^^^ @@ -11,7 +11,7 @@ LL | const fn unwrap_or_else<F: FnOnce() -> T + ~const std::ops::FnOnce<()>> | +++++++++++++++++++++++++++++ error[E0493]: destructors cannot be evaluated at compile-time - --> $DIR/unstable-const-fn-in-libcore.rs:19:53 + --> $DIR/unstable-const-fn-in-libcore.rs:18:53 | LL | const fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T { | ^ constant functions cannot evaluate destructors @@ -20,7 +20,7 @@ LL | } | - value is dropped here error[E0493]: destructors cannot be evaluated at compile-time - --> $DIR/unstable-const-fn-in-libcore.rs:19:47 + --> $DIR/unstable-const-fn-in-libcore.rs:18:47 | LL | const fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T { | ^^^^ constant functions cannot evaluate destructors |
