Skip to content

Commit 6c62322

Browse files
committed
const_let: --bless with --compare-mode=nll
1 parent 3dc08ed commit 6c62322

File tree

4 files changed

+74
-77
lines changed

4 files changed

+74
-77
lines changed

src/test/ui/check-static-values-constraints.nll.stderr

+52-10
Original file line numberDiff line numberDiff line change
@@ -13,44 +13,80 @@ error[E0010]: allocations are not allowed in statics
1313
LL | static STATIC11: Box<MyOwned> = box MyOwned;
1414
| ^^^^^^^^^^^ allocation not allowed in statics
1515

16+
error[E0019]: static contains unimplemented expression type
17+
--> $DIR/check-static-values-constraints.rs:79:37
18+
|
19+
LL | static STATIC11: Box<MyOwned> = box MyOwned;
20+
| ^^^^^^^
21+
1622
error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants
17-
--> $DIR/check-static-values-constraints.rs:89:32
23+
--> $DIR/check-static-values-constraints.rs:90:32
1824
|
1925
LL | field2: SafeEnum::Variant4("str".to_string())
2026
| ^^^^^^^^^^^^^^^^^
2127

2228
error[E0010]: allocations are not allowed in statics
23-
--> $DIR/check-static-values-constraints.rs:94:5
29+
--> $DIR/check-static-values-constraints.rs:95:5
2430
|
2531
LL | box MyOwned, //~ ERROR allocations are not allowed in statics
2632
| ^^^^^^^^^^^ allocation not allowed in statics
2733

34+
error[E0019]: static contains unimplemented expression type
35+
--> $DIR/check-static-values-constraints.rs:95:9
36+
|
37+
LL | box MyOwned, //~ ERROR allocations are not allowed in statics
38+
| ^^^^^^^
39+
2840
error[E0010]: allocations are not allowed in statics
29-
--> $DIR/check-static-values-constraints.rs:95:5
41+
--> $DIR/check-static-values-constraints.rs:97:5
3042
|
3143
LL | box MyOwned, //~ ERROR allocations are not allowed in statics
3244
| ^^^^^^^^^^^ allocation not allowed in statics
3345

46+
error[E0019]: static contains unimplemented expression type
47+
--> $DIR/check-static-values-constraints.rs:97:9
48+
|
49+
LL | box MyOwned, //~ ERROR allocations are not allowed in statics
50+
| ^^^^^^^
51+
3452
error[E0010]: allocations are not allowed in statics
35-
--> $DIR/check-static-values-constraints.rs:99:6
53+
--> $DIR/check-static-values-constraints.rs:102:6
3654
|
3755
LL | &box MyOwned, //~ ERROR allocations are not allowed in statics
3856
| ^^^^^^^^^^^ allocation not allowed in statics
3957

58+
error[E0019]: static contains unimplemented expression type
59+
--> $DIR/check-static-values-constraints.rs:102:10
60+
|
61+
LL | &box MyOwned, //~ ERROR allocations are not allowed in statics
62+
| ^^^^^^^
63+
4064
error[E0010]: allocations are not allowed in statics
41-
--> $DIR/check-static-values-constraints.rs:100:6
65+
--> $DIR/check-static-values-constraints.rs:104:6
4266
|
4367
LL | &box MyOwned, //~ ERROR allocations are not allowed in statics
4468
| ^^^^^^^^^^^ allocation not allowed in statics
4569

70+
error[E0019]: static contains unimplemented expression type
71+
--> $DIR/check-static-values-constraints.rs:104:10
72+
|
73+
LL | &box MyOwned, //~ ERROR allocations are not allowed in statics
74+
| ^^^^^^^
75+
4676
error[E0010]: allocations are not allowed in statics
47-
--> $DIR/check-static-values-constraints.rs:106:5
77+
--> $DIR/check-static-values-constraints.rs:111:5
4878
|
4979
LL | box 3;
5080
| ^^^^^ allocation not allowed in statics
5181

82+
error[E0019]: static contains unimplemented expression type
83+
--> $DIR/check-static-values-constraints.rs:111:9
84+
|
85+
LL | box 3;
86+
| ^
87+
5288
error[E0507]: cannot move out of static item
53-
--> $DIR/check-static-values-constraints.rs:110:45
89+
--> $DIR/check-static-values-constraints.rs:116:45
5490
|
5591
LL | let y = { static x: Box<isize> = box 3; x };
5692
| ^
@@ -59,12 +95,18 @@ LL | let y = { static x: Box<isize> = box 3; x };
5995
| help: consider borrowing here: `&x`
6096

6197
error[E0010]: allocations are not allowed in statics
62-
--> $DIR/check-static-values-constraints.rs:110:38
98+
--> $DIR/check-static-values-constraints.rs:116:38
6399
|
64100
LL | let y = { static x: Box<isize> = box 3; x };
65101
| ^^^^^ allocation not allowed in statics
66102

67-
error: aborting due to 10 previous errors
103+
error[E0019]: static contains unimplemented expression type
104+
--> $DIR/check-static-values-constraints.rs:116:42
105+
|
106+
LL | let y = { static x: Box<isize> = box 3; x };
107+
| ^
108+
109+
error: aborting due to 17 previous errors
68110

69-
Some errors occurred: E0010, E0015, E0493, E0507.
111+
Some errors occurred: E0010, E0015, E0019, E0493, E0507.
70112
For more information about an error, try `rustc --explain E0010`.

src/test/ui/consts/min_const_fn/min_const_fn.nll.stderr

+1-7
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,6 @@ error: `if`, `match`, `&&` and `||` are not stable in const fn
112112
LL | const fn foo30_5(b: bool) { while b { } } //~ ERROR not stable in const fn
113113
| ^^^^^^^^^^^
114114

115-
error: local variables in const fn are unstable
116-
--> $DIR/min_const_fn.rs:99:34
117-
|
118-
LL | const fn foo30_6() -> bool { let x = true; x } //~ ERROR local variables in const fn
119-
| ^
120-
121115
error: `if`, `match`, `&&` and `||` are not stable in const fn
122116
--> $DIR/min_const_fn.rs:100:44
123117
|
@@ -220,7 +214,7 @@ error: function pointers in const fn are unstable
220214
LL | const fn no_fn_ptrs2() -> fn() { fn foo() {} foo }
221215
| ^^^^
222216

223-
error: aborting due to 35 previous errors
217+
error: aborting due to 34 previous errors
224218

225219
Some errors occurred: E0493, E0515.
226220
For more information about an error, try `rustc --explain E0493`.
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0597]: `y` does not live long enough
2-
--> $DIR/promote_const_let.rs:6:9
2+
--> $DIR/promote_const_let.rs:4:9
33
|
44
LL | let x: &'static u32 = {
55
| ------------ type annotation requires that `y` is borrowed for `'static`
@@ -9,6 +9,21 @@ LL | &y //~ ERROR does not live long enough
99
LL | };
1010
| - `y` dropped here while still borrowed
1111

12-
error: aborting due to previous error
12+
error[E0716]: temporary value dropped while borrowed
13+
--> $DIR/promote_const_let.rs:6:28
14+
|
15+
LL | let x: &'static u32 = &{ //~ ERROR does not live long enough
16+
| ____________------------____^
17+
| | |
18+
| | type annotation requires that borrow lasts for `'static`
19+
LL | | let y = 42;
20+
LL | | y
21+
LL | | };
22+
| |_____^ creates a temporary which is freed while still in use
23+
LL | }
24+
| - temporary value is freed at the end of this statement
25+
26+
error: aborting due to 2 previous errors
1327

14-
For more information about this error, try `rustc --explain E0597`.
28+
Some errors occurred: E0597, E0716.
29+
For more information about an error, try `rustc --explain E0597`.
+3-57
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,14 @@
1-
error[E0658]: let bindings in constants are unstable (see issue #48821)
2-
--> $DIR/issue-18118.rs:5:17
3-
|
4-
LL | let p = 3;
5-
| ^
6-
|
7-
= help: add #![feature(const_let)] to the crate attributes to enable
8-
9-
error[E0658]: statements in constants are unstable (see issue #48821)
10-
--> $DIR/issue-18118.rs:5:17
11-
|
12-
LL | let p = 3;
13-
| ^
14-
|
15-
= help: add #![feature(const_let)] to the crate attributes to enable
16-
17-
error[E0658]: let bindings in constants are unstable (see issue #48821)
18-
--> $DIR/issue-18118.rs:8:9
19-
|
20-
LL | &p //~ ERROR `p` does not live long enough
21-
| ^^
22-
|
23-
= help: add #![feature(const_let)] to the crate attributes to enable
24-
25-
error[E0658]: let bindings in constants are unstable (see issue #48821)
26-
--> $DIR/issue-18118.rs:2:5
27-
|
28-
LL | / const z: &'static isize = {
29-
LL | | //~^ ERROR let bindings in constants are unstable
30-
LL | | //~| ERROR statements in constants are unstable
31-
LL | | let p = 3;
32-
... |
33-
LL | | //~^ ERROR let bindings in constants are unstable
34-
LL | | };
35-
| |______^
36-
|
37-
= help: add #![feature(const_let)] to the crate attributes to enable
38-
39-
error[E0658]: statements in constants are unstable (see issue #48821)
40-
--> $DIR/issue-18118.rs:2:5
41-
|
42-
LL | / const z: &'static isize = {
43-
LL | | //~^ ERROR let bindings in constants are unstable
44-
LL | | //~| ERROR statements in constants are unstable
45-
LL | | let p = 3;
46-
... |
47-
LL | | //~^ ERROR let bindings in constants are unstable
48-
LL | | };
49-
| |______^
50-
|
51-
= help: add #![feature(const_let)] to the crate attributes to enable
52-
531
error[E0597]: `p` does not live long enough
54-
--> $DIR/issue-18118.rs:8:9
2+
--> $DIR/issue-18118.rs:4:9
553
|
564
LL | &p //~ ERROR `p` does not live long enough
575
| ^^
586
| |
597
| borrowed value does not live long enough
608
| using this value as a constant requires that `p` is borrowed for `'static`
61-
LL | //~^ ERROR let bindings in constants are unstable
629
LL | };
6310
| - `p` dropped here while still borrowed
6411

65-
error: aborting due to 6 previous errors
12+
error: aborting due to previous error
6613

67-
Some errors occurred: E0597, E0658.
68-
For more information about an error, try `rustc --explain E0597`.
14+
For more information about this error, try `rustc --explain E0597`.

0 commit comments

Comments
 (0)