Skip to content

Commit 9273962

Browse files
committed
remove no longer needed feature flags
1 parent e2c99f0 commit 9273962

16 files changed

+128
-42
lines changed

src/test/ui/consts/miri_unleashed/box.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// compile-flags: -Zunleash-the-miri-inside-of-you
2-
#![feature(const_mut_refs, box_syntax)]
2+
#![feature(box_syntax)]
33
#![allow(const_err)]
44

55
use std::mem::ManuallyDrop;
@@ -11,4 +11,7 @@ static TEST_BAD: &mut i32 = {
1111
//~^ WARN skipping const check
1212
//~| ERROR could not evaluate static initializer
1313
//~| NOTE heap allocations
14+
//~| WARN skipping const checks
15+
//~| WARN skipping const checks
16+
//~| WARN skipping const checks
1417
};

src/test/ui/consts/miri_unleashed/box.stderr

+19-1
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,30 @@ warning: skipping const checks
44
LL | &mut *(box 0)
55
| ^^^^^^^
66

7+
warning: skipping const checks
8+
--> $DIR/box.rs:10:16
9+
|
10+
LL | &mut *(box 0)
11+
| ^
12+
13+
warning: skipping const checks
14+
--> $DIR/box.rs:10:5
15+
|
16+
LL | &mut *(box 0)
17+
| ^^^^^^^^^^^^^
18+
19+
warning: skipping const checks
20+
--> $DIR/box.rs:10:5
21+
|
22+
LL | &mut *(box 0)
23+
| ^^^^^^^^^^^^^
24+
725
error[E0080]: could not evaluate static initializer
826
--> $DIR/box.rs:10:11
927
|
1028
LL | &mut *(box 0)
1129
| ^^^^^^^ "heap allocations via `box` keyword" needs an rfc before being allowed inside constants
1230

13-
error: aborting due to previous error; 1 warning emitted
31+
error: aborting due to previous error; 4 warnings emitted
1432

1533
For more information about this error, try `rustc --explain E0080`.

src/test/ui/consts/miri_unleashed/const_refers_to_static.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// compile-flags: -Zunleash-the-miri-inside-of-you
33
#![allow(const_err)]
44

5-
#![feature(const_raw_ptr_deref)]
6-
75
use std::sync::atomic::AtomicUsize;
86
use std::sync::atomic::Ordering;
97

@@ -21,6 +19,7 @@ const READ_INTERIOR_MUT: usize = {
2119
static FOO: AtomicUsize = AtomicUsize::new(0);
2220
unsafe { *(&FOO as *const _ as *const usize) }
2321
//~^ WARN skipping const checks
22+
//~| WARN skipping const checks
2423
};
2524

2625
static mut MUTABLE: u32 = 0;
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,57 @@
11
warning: skipping const checks
2-
--> $DIR/const_refers_to_static.rs:15:5
2+
--> $DIR/const_refers_to_static.rs:13:5
33
|
44
LL | FOO.fetch_add(1, Ordering::Relaxed)
55
| ^^^
66

77
warning: skipping const checks
8-
--> $DIR/const_refers_to_static.rs:15:5
8+
--> $DIR/const_refers_to_static.rs:13:5
99
|
1010
LL | FOO.fetch_add(1, Ordering::Relaxed)
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1212

1313
warning: skipping const checks
14-
--> $DIR/const_refers_to_static.rs:22:17
14+
--> $DIR/const_refers_to_static.rs:20:17
1515
|
1616
LL | unsafe { *(&FOO as *const _ as *const usize) }
1717
| ^^^
1818

1919
warning: skipping const checks
20-
--> $DIR/const_refers_to_static.rs:27:32
20+
--> $DIR/const_refers_to_static.rs:20:14
21+
|
22+
LL | unsafe { *(&FOO as *const _ as *const usize) }
23+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24+
25+
warning: skipping const checks
26+
--> $DIR/const_refers_to_static.rs:26:32
2127
|
2228
LL | const READ_MUT: u32 = unsafe { MUTABLE };
2329
| ^^^^^^^
2430

2531
warning: skipping const checks
26-
--> $DIR/const_refers_to_static.rs:27:32
32+
--> $DIR/const_refers_to_static.rs:26:32
2733
|
2834
LL | const READ_MUT: u32 = unsafe { MUTABLE };
2935
| ^^^^^^^
3036

3137
error[E0080]: erroneous constant used
32-
--> $DIR/const_refers_to_static.rs:32:5
38+
--> $DIR/const_refers_to_static.rs:31:5
3339
|
3440
LL | MUTATE_INTERIOR_MUT;
3541
| ^^^^^^^^^^^^^^^^^^^ referenced constant has errors
3642

3743
error[E0080]: erroneous constant used
38-
--> $DIR/const_refers_to_static.rs:34:5
44+
--> $DIR/const_refers_to_static.rs:33:5
3945
|
4046
LL | READ_INTERIOR_MUT;
4147
| ^^^^^^^^^^^^^^^^^ referenced constant has errors
4248

4349
error[E0080]: erroneous constant used
44-
--> $DIR/const_refers_to_static.rs:36:5
50+
--> $DIR/const_refers_to_static.rs:35:5
4551
|
4652
LL | READ_MUT;
4753
| ^^^^^^^^ referenced constant has errors
4854

49-
error: aborting due to 3 previous errors; 5 warnings emitted
55+
error: aborting due to 3 previous errors; 6 warnings emitted
5056

5157
For more information about this error, try `rustc --explain E0080`.

src/test/ui/consts/miri_unleashed/const_refers_to_static2.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// compile-flags: -Zunleash-the-miri-inside-of-you
22
#![allow(const_err)]
33

4-
#![feature(const_raw_ptr_deref)]
5-
64
use std::sync::atomic::AtomicUsize;
75
use std::sync::atomic::Ordering;
86

@@ -15,6 +13,7 @@ const REF_INTERIOR_MUT: &usize = { //~ ERROR undefined behavior to use this valu
1513
static FOO: AtomicUsize = AtomicUsize::new(0);
1614
unsafe { &*(&FOO as *const _ as *const usize) }
1715
//~^ WARN skipping const checks
16+
//~| WARN skipping const checks
1817
};
1918

2019
// ok some day perhaps
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,37 @@
11
warning: skipping const checks
2-
--> $DIR/const_refers_to_static2.rs:16:18
2+
--> $DIR/const_refers_to_static2.rs:14:18
33
|
44
LL | unsafe { &*(&FOO as *const _ as *const usize) }
55
| ^^^
66

77
warning: skipping const checks
8-
--> $DIR/const_refers_to_static2.rs:25:6
8+
--> $DIR/const_refers_to_static2.rs:14:14
9+
|
10+
LL | unsafe { &*(&FOO as *const _ as *const usize) }
11+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12+
13+
warning: skipping const checks
14+
--> $DIR/const_refers_to_static2.rs:24:6
915
|
1016
LL | &FOO
1117
| ^^^
1218

1319
error[E0080]: it is undefined behavior to use this value
14-
--> $DIR/const_refers_to_static2.rs:12:1
20+
--> $DIR/const_refers_to_static2.rs:10:1
1521
|
1622
LL | / const REF_INTERIOR_MUT: &usize = {
1723
LL | |
1824
LL | |
1925
LL | | static FOO: AtomicUsize = AtomicUsize::new(0);
20-
LL | | unsafe { &*(&FOO as *const _ as *const usize) }
26+
... |
2127
LL | |
2228
LL | | };
2329
| |__^ type validation failed: encountered a reference pointing to a static variable
2430
|
2531
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
2632

2733
error[E0080]: it is undefined behavior to use this value
28-
--> $DIR/const_refers_to_static2.rs:21:1
34+
--> $DIR/const_refers_to_static2.rs:20:1
2935
|
3036
LL | / const READ_IMMUT: &usize = {
3137
LL | |
@@ -38,6 +44,6 @@ LL | | };
3844
|
3945
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
4046

41-
error: aborting due to 2 previous errors; 2 warnings emitted
47+
error: aborting due to 2 previous errors; 3 warnings emitted
4248

4349
For more information about this error, try `rustc --explain E0080`.

src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// aux-build:static_cross_crate.rs
33
#![allow(const_err)]
44

5-
#![feature(exclusive_range_pattern, half_open_range_patterns, const_if_match, const_panic)]
5+
#![feature(exclusive_range_pattern, half_open_range_patterns, const_if_match)]
66

77
extern crate static_cross_crate;
88

@@ -34,6 +34,7 @@ const U8_MUT2: &u8 = { //~ NOTE
3434
const U8_MUT3: &u8 = { //~ NOTE
3535
unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
3636
//~^ WARN skipping const checks
37+
//~| WARN skipping const checks
3738
//~| WARN [const_err]
3839
//~| NOTE constant accesses static
3940
};

src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.stderr

+14-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ LL | | };
1818
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
1919

2020
error: could not evaluate constant pattern
21-
--> $DIR/const_refers_to_static_cross_crate.rs:43:9
21+
--> $DIR/const_refers_to_static_cross_crate.rs:44:9
2222
|
2323
LL | SLICE_MUT => true,
2424
| ^^^^^^^^^
@@ -43,7 +43,7 @@ LL | | };
4343
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
4444

4545
error: could not evaluate constant pattern
46-
--> $DIR/const_refers_to_static_cross_crate.rs:51:9
46+
--> $DIR/const_refers_to_static_cross_crate.rs:52:9
4747
|
4848
LL | U8_MUT => true,
4949
| ^^^^^^
@@ -73,7 +73,7 @@ LL | #[warn(const_err)]
7373
| ^^^^^^^^^
7474

7575
error: could not evaluate constant pattern
76-
--> $DIR/const_refers_to_static_cross_crate.rs:61:9
76+
--> $DIR/const_refers_to_static_cross_crate.rs:62:9
7777
|
7878
LL | U8_MUT2 => true,
7979
| ^^^^^^^
@@ -84,6 +84,14 @@ warning: skipping const checks
8484
LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
8585
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8686

87+
warning: skipping const checks
88+
--> $DIR/const_refers_to_static_cross_crate.rs:35:77
89+
|
90+
LL | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } }
91+
| ^^^^^^^^
92+
|
93+
= note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
94+
8795
warning: any use of this value will cause an error
8896
--> $DIR/const_refers_to_static_cross_crate.rs:35:51
8997
|
@@ -93,6 +101,7 @@ LL | | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None
93101
LL | |
94102
LL | |
95103
LL | |
104+
LL | |
96105
LL | | };
97106
| |__-
98107
|
@@ -103,11 +112,11 @@ LL | #[warn(const_err)]
103112
| ^^^^^^^^^
104113

105114
error: could not evaluate constant pattern
106-
--> $DIR/const_refers_to_static_cross_crate.rs:68:9
115+
--> $DIR/const_refers_to_static_cross_crate.rs:69:9
107116
|
108117
LL | U8_MUT3 => true,
109118
| ^^^^^^^
110119

111-
error: aborting due to 6 previous errors; 6 warnings emitted
120+
error: aborting due to 6 previous errors; 7 warnings emitted
112121

113122
For more information about this error, try `rustc --explain E0080`.

src/test/ui/consts/miri_unleashed/mutable_const.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// compile-flags: -Zunleash-the-miri-inside-of-you
22
// normalize-stderr-test "alloc[0-9]+" -> "allocN"
33

4-
#![feature(const_raw_ptr_deref)]
5-
#![feature(const_mut_refs)]
64
#![deny(const_err)] // The `allow` variant is tested by `mutable_const2`.
75
//~^ NOTE lint level
86
// Here we check that even though `MUTABLE_BEHIND_RAW` is created from a mutable
@@ -20,6 +18,8 @@ const MUTATING_BEHIND_RAW: () = { //~ NOTE
2018
unsafe {
2119
*MUTABLE_BEHIND_RAW = 99 //~ ERROR any use of this value will cause an error
2220
//~^ NOTE: which is read-only
21+
//~| WARN skipping const checks
22+
//~| WARN skipping const checks
2323
// FIXME would be good to match more of the error message here, but looks like we
2424
// normalize *after* checking the annoations here.
2525
}

src/test/ui/consts/miri_unleashed/mutable_const.stderr

+16-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
warning: skipping const checks
2-
--> $DIR/mutable_const.rs:15:38
2+
--> $DIR/mutable_const.rs:13:38
33
|
44
LL | const MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _;
55
| ^^^^^^^^^^^^^^^^^^^^
66

7+
warning: skipping const checks
8+
--> $DIR/mutable_const.rs:19:9
9+
|
10+
LL | *MUTABLE_BEHIND_RAW = 99
11+
| ^^^^^^^^^^^^^^^^^^^^^^^^
12+
13+
warning: skipping const checks
14+
--> $DIR/mutable_const.rs:19:9
15+
|
16+
LL | *MUTABLE_BEHIND_RAW = 99
17+
| ^^^^^^^^^^^^^^^^^^^^^^^^
18+
719
error: any use of this value will cause an error
8-
--> $DIR/mutable_const.rs:21:9
20+
--> $DIR/mutable_const.rs:19:9
921
|
1022
LL | / const MUTATING_BEHIND_RAW: () = {
1123
LL | | // Test that `MUTABLE_BEHIND_RAW` is actually immutable, by doing this at const time.
@@ -18,10 +30,10 @@ LL | | };
1830
| |__-
1931
|
2032
note: the lint level is defined here
21-
--> $DIR/mutable_const.rs:6:9
33+
--> $DIR/mutable_const.rs:4:9
2234
|
2335
LL | #![deny(const_err)] // The `allow` variant is tested by `mutable_const2`.
2436
| ^^^^^^^^^
2537

26-
error: aborting due to previous error; 1 warning emitted
38+
error: aborting due to previous error; 3 warnings emitted
2739

src/test/ui/consts/miri_unleashed/mutable_const2.rs

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
// normalize-stderr-test "note: compiler flags: .*" -> "note: compiler flags: FLAGS"
66
// normalize-stderr-test "interpret/intern.rs:[0-9]+:[0-9]+" -> "interpret/intern.rs:LL:CC"
77

8-
#![feature(const_raw_ptr_deref)]
9-
#![feature(const_mut_refs)]
108
#![allow(const_err)]
119

1210
use std::cell::UnsafeCell;

src/test/ui/consts/miri_unleashed/mutable_const2.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
warning: skipping const checks
2-
--> $DIR/mutable_const2.rs:15:38
2+
--> $DIR/mutable_const2.rs:13:38
33
|
44
LL | const MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _;
55
| ^^^^^^^^^^^^^^^^^^^^
66

77
warning: 1 warning emitted
88

99
error: internal compiler error: mutable allocation in constant
10-
--> $DIR/mutable_const2.rs:15:1
10+
--> $DIR/mutable_const2.rs:13:1
1111
|
1212
LL | const MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _;
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/test/ui/consts/miri_unleashed/mutable_references.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// compile-flags: -Zunleash-the-miri-inside-of-you
2-
#![feature(const_mut_refs)]
32
#![allow(const_err)]
43

54
use std::cell::UnsafeCell;
@@ -8,15 +7,18 @@ use std::cell::UnsafeCell;
87

98
// this is fine because is not possible to mutate through an immutable reference.
109
static FOO: &&mut u32 = &&mut 42;
10+
//~^ WARN skipping const checks
1111

1212
// this is fine because accessing an immutable static `BAR` is equivalent to accessing `*&BAR`
1313
// which puts the mutable reference behind an immutable one.
1414
static BAR: &mut () = &mut ();
15+
//~^ WARN skipping const checks
1516

1617
struct Foo<T>(T);
1718

1819
// this is fine for the same reason as `BAR`.
1920
static BOO: &mut Foo<()> = &mut Foo(());
21+
//~^ WARN skipping const checks
2022

2123
struct Meh {
2224
x: &'static UnsafeCell<i32>,
@@ -31,6 +33,7 @@ static MEH: Meh = Meh {
3133

3234
// this is fine for the same reason as `BAR`.
3335
static OH_YES: &mut i32 = &mut 42;
36+
//~^ WARN skipping const checks
3437

3538
fn main() {
3639
unsafe {

0 commit comments

Comments
 (0)