Skip to content

Commit 025630d

Browse files
committed
Bless remaining test output
1 parent 9abc34e commit 025630d

7 files changed

+28
-45
lines changed

src/test/mir-opt/const_prop/read_immutable_static.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ fn main() {
1010
// START rustc.main.ConstProp.before.mir
1111
// bb0: {
1212
// ...
13-
// _2 = (FOO: u8);
13+
// _3 = const Scalar(AllocId(0).0x0) : &u8;
14+
// _2 = (*_3);
1415
// ...
15-
// _3 = (FOO: u8);
16-
// _1 = Add(move _2, move _3);
16+
// _5 = const Scalar(AllocId(0).0x0) : &u8;
17+
// _4 = (*_5);
18+
// _1 = Add(move _2, move _4);
1719
// ...
1820
// }
1921
// END rustc.main.ConstProp.before.mir
@@ -22,8 +24,8 @@ fn main() {
2224
// ...
2325
// _2 = const 2u8;
2426
// ...
25-
// _3 = const 2u8;
26-
// _1 = Add(move _2, move _3);
27+
// _4 = const 2u8;
28+
// _1 = Add(move _2, move _4);
2729
// ...
2830
// }
2931
// END rustc.main.ConstProp.after.mir

src/test/ui/consts/projection_qualif.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ error[E0017]: references in constants may only refer to immutable values
44
LL | let b: *mut u32 = &mut a;
55
| ^^^^^^ constants require immutable values
66

7-
error[E0019]: constant contains unimplemented expression type
7+
error[E0658]: dereferencing raw pointers in constants is unstable
88
--> $DIR/projection_qualif.rs:7:18
99
|
1010
LL | unsafe { *b = 5; }
1111
| ^^^^^^
12+
|
13+
= note: for more information, see https://github.com/rust-lang/rust/issues/51911
14+
= help: add `#![feature(const_raw_ptr_deref)]` to the crate attributes to enable
1215

13-
error[E0658]: dereferencing raw pointers in constants is unstable
16+
error[E0019]: constant contains unimplemented expression type
1417
--> $DIR/projection_qualif.rs:7:18
1518
|
1619
LL | unsafe { *b = 5; }
1720
| ^^^^^^
18-
|
19-
= note: for more information, see https://github.com/rust-lang/rust/issues/51911
20-
= help: add `#![feature(const_raw_ptr_deref)]` to the crate attributes to enable
2121

2222
error: aborting due to 3 previous errors
2323

src/test/ui/issues/issue-17718-const-bad-values.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ error[E0017]: references in constants may only refer to immutable values
44
LL | const C1: &'static mut [usize] = &mut [];
55
| ^^^^^^^ constants require immutable values
66

7-
error[E0017]: references in constants may only refer to immutable values
8-
--> $DIR/issue-17718-const-bad-values.rs:5:41
7+
error[E0013]: constants cannot refer to statics, use a constant instead
8+
--> $DIR/issue-17718-const-bad-values.rs:5:46
99
|
1010
LL | const C2: &'static mut usize = unsafe { &mut S };
11-
| ^^^^^^ constants require immutable values
11+
| ^
1212

13-
error[E0013]: constants cannot refer to statics, use a constant instead
13+
error[E0017]: references in constants may only refer to immutable values
1414
--> $DIR/issue-17718-const-bad-values.rs:5:41
1515
|
1616
LL | const C2: &'static mut usize = unsafe { &mut S };
17-
| ^^^^^^
17+
| ^^^^^^ constants require immutable values
1818

1919
error: aborting due to 3 previous errors
2020

src/test/ui/issues/issue-17718-references.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0013]: constants cannot refer to statics, use a constant instead
2-
--> $DIR/issue-17718-references.rs:9:28
2+
--> $DIR/issue-17718-references.rs:9:29
33
|
44
LL | const T2: &'static usize = &S;
5-
| ^^
5+
| ^
66

77
error[E0013]: constants cannot refer to statics, use a constant instead
88
--> $DIR/issue-17718-references.rs:14:19

src/test/ui/issues/issue-18118-2.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0013]: constants cannot refer to statics, use a constant instead
2-
--> $DIR/issue-18118-2.rs:4:9
2+
--> $DIR/issue-18118-2.rs:4:10
33
|
44
LL | &p
5-
| ^^
5+
| ^
66

77
error: aborting due to previous error
88

src/test/ui/thread-local-in-ctfe.rs

-2
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,12 @@ static B: u32 = A;
88

99
static C: &u32 = &A;
1010
//~^ ERROR thread-local statics cannot be accessed at compile-time
11-
//~| ERROR thread-local variable borrowed past end of function
1211

1312
const D: u32 = A;
1413
//~^ ERROR thread-local statics cannot be accessed at compile-time
1514

1615
const E: &u32 = &A;
1716
//~^ ERROR thread-local statics cannot be accessed at compile-time
18-
//~| ERROR thread-local variable borrowed past end of function
1917

2018
const fn f() -> u32 {
2119
A

src/test/ui/thread-local-in-ctfe.stderr

+7-24
Original file line numberDiff line numberDiff line change
@@ -5,45 +5,28 @@ LL | static B: u32 = A;
55
| ^
66

77
error[E0625]: thread-local statics cannot be accessed at compile-time
8-
--> $DIR/thread-local-in-ctfe.rs:9:18
8+
--> $DIR/thread-local-in-ctfe.rs:9:19
99
|
1010
LL | static C: &u32 = &A;
11-
| ^^
12-
13-
error[E0712]: thread-local variable borrowed past end of function
14-
--> $DIR/thread-local-in-ctfe.rs:9:18
15-
|
16-
LL | static C: &u32 = &A;
17-
| ^^- end of enclosing function is here
18-
| |
19-
| thread-local variables cannot be borrowed beyond the end of the function
11+
| ^
2012

2113
error[E0625]: thread-local statics cannot be accessed at compile-time
22-
--> $DIR/thread-local-in-ctfe.rs:13:16
14+
--> $DIR/thread-local-in-ctfe.rs:12:16
2315
|
2416
LL | const D: u32 = A;
2517
| ^
2618

2719
error[E0625]: thread-local statics cannot be accessed at compile-time
28-
--> $DIR/thread-local-in-ctfe.rs:16:17
29-
|
30-
LL | const E: &u32 = &A;
31-
| ^^
32-
33-
error[E0712]: thread-local variable borrowed past end of function
34-
--> $DIR/thread-local-in-ctfe.rs:16:17
20+
--> $DIR/thread-local-in-ctfe.rs:15:18
3521
|
3622
LL | const E: &u32 = &A;
37-
| ^^- end of enclosing function is here
38-
| |
39-
| thread-local variables cannot be borrowed beyond the end of the function
23+
| ^
4024

4125
error[E0625]: thread-local statics cannot be accessed at compile-time
42-
--> $DIR/thread-local-in-ctfe.rs:21:5
26+
--> $DIR/thread-local-in-ctfe.rs:19:5
4327
|
4428
LL | A
4529
| ^
4630

47-
error: aborting due to 7 previous errors
31+
error: aborting due to 5 previous errors
4832

49-
For more information about this error, try `rustc --explain E0712`.

0 commit comments

Comments
 (0)