Skip to content

Commit 3325671

Browse files
Bless modified tests
1 parent caa7c99 commit 3325671

File tree

7 files changed

+298
-80
lines changed

7 files changed

+298
-80
lines changed
Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
error[E0493]: destructors cannot be evaluated at compile-time
2-
--> $DIR/drop-failure.rs:6:9
2+
--> $DIR/drop-failure.rs:7:9
33
|
44
LL | let x = Some(Vec::new());
55
| ^ constants cannot evaluate destructors
66

77
error[E0493]: destructors cannot be evaluated at compile-time
8-
--> $DIR/drop-failure.rs:19:9
8+
--> $DIR/drop-failure.rs:20:9
99
|
1010
LL | let vec_tuple = (Vec::new(),);
1111
| ^^^^^^^^^ constants cannot evaluate destructors
1212

1313
error[E0493]: destructors cannot be evaluated at compile-time
14-
--> $DIR/drop-failure.rs:27:9
14+
--> $DIR/drop-failure.rs:28:9
1515
|
1616
LL | let x: Result<_, Vec<i32>> = Ok(Vec::new());
1717
| ^ constants cannot evaluate destructors
1818

19-
error: aborting due to 3 previous errors
19+
error[E0493]: destructors cannot be evaluated at compile-time
20+
--> $DIR/drop-failure.rs:38:9
21+
|
22+
LL | let mut tmp = None;
23+
| ^^^^^^^ constants cannot evaluate destructors
24+
25+
error: aborting due to 4 previous errors
2026

2127
For more information about this error, try `rustc --explain E0493`.
Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,35 @@
11
error[E0716]: temporary value dropped while borrowed
2-
--> $DIR/interior-mutability.rs:25:26
2+
--> $DIR/interior-mutability.rs:40:26
33
|
44
LL | let x: &'static _ = &X;
55
| ---------- ^ creates a temporary which is freed while still in use
66
| |
77
| type annotation requires that borrow lasts for `'static`
8-
LL | let y: &'static _ = &Y;
8+
...
99
LL | }
1010
| - temporary value is freed at the end of this statement
1111

1212
error[E0716]: temporary value dropped while borrowed
13-
--> $DIR/interior-mutability.rs:26:26
13+
--> $DIR/interior-mutability.rs:41:26
1414
|
1515
LL | let y: &'static _ = &Y;
1616
| ---------- ^ creates a temporary which is freed while still in use
1717
| |
1818
| type annotation requires that borrow lasts for `'static`
19+
LL | let z: &'static _ = &Z;
20+
LL | }
21+
| - temporary value is freed at the end of this statement
22+
23+
error[E0716]: temporary value dropped while borrowed
24+
--> $DIR/interior-mutability.rs:42:26
25+
|
26+
LL | let z: &'static _ = &Z;
27+
| ---------- ^ creates a temporary which is freed while still in use
28+
| |
29+
| type annotation requires that borrow lasts for `'static`
1930
LL | }
2031
| - temporary value is freed at the end of this statement
2132

22-
error: aborting due to 2 previous errors
33+
error: aborting due to 3 previous errors
2334

2435
For more information about this error, try `rustc --explain E0716`.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
error[E0744]: `for` is not allowed in a `const`
2+
--> $DIR/loop.rs:63:5
3+
|
4+
LL | / for i in 0..4 {
5+
LL | | x += i;
6+
LL | | }
7+
| |_____^
8+
9+
error[E0744]: `for` is not allowed in a `const`
10+
--> $DIR/loop.rs:67:5
11+
|
12+
LL | / for i in 0..4 {
13+
LL | | x += i;
14+
LL | | }
15+
| |_____^
16+
17+
error: aborting due to 2 previous errors
18+
19+
For more information about this error, try `rustc --explain E0744`.
Lines changed: 69 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,88 @@
1-
error[E0744]: `loop` is not allowed in a `const`
2-
--> $DIR/loop.rs:8:15
1+
error[E0658]: `loop` is not allowed in a `const`
2+
--> $DIR/loop.rs:10:15
33
|
44
LL | const _: () = loop {};
55
| ^^^^^^^
6+
|
7+
= note: for more information, see https://github.com/rust-lang/rust/issues/52000
8+
= help: add `#![feature(const_loop)]` to the crate attributes to enable
69

7-
error[E0744]: `loop` is not allowed in a `static`
8-
--> $DIR/loop.rs:10:19
10+
error[E0658]: `loop` is not allowed in a `static`
11+
--> $DIR/loop.rs:12:19
912
|
1013
LL | static FOO: i32 = loop { break 4; };
1114
| ^^^^^^^^^^^^^^^^^
15+
|
16+
= note: for more information, see https://github.com/rust-lang/rust/issues/52000
17+
= help: add `#![feature(const_loop)]` to the crate attributes to enable
1218

13-
error[E0744]: `loop` is not allowed in a `const fn`
14-
--> $DIR/loop.rs:13:5
19+
error[E0658]: `loop` is not allowed in a `const fn`
20+
--> $DIR/loop.rs:15:5
1521
|
1622
LL | loop {}
1723
| ^^^^^^^
24+
|
25+
= note: for more information, see https://github.com/rust-lang/rust/issues/52000
26+
= help: add `#![feature(const_loop)]` to the crate attributes to enable
1827

19-
error[E0744]: `loop` is not allowed in a `const fn`
20-
--> $DIR/loop.rs:26:9
28+
error[E0658]: `loop` is not allowed in a `const fn`
29+
--> $DIR/loop.rs:28:9
2130
|
2231
LL | loop {}
2332
| ^^^^^^^
33+
|
34+
= note: for more information, see https://github.com/rust-lang/rust/issues/52000
35+
= help: add `#![feature(const_loop)]` to the crate attributes to enable
2436

25-
error[E0744]: `while` is not allowed in a `const`
26-
--> $DIR/loop.rs:38:9
37+
error[E0658]: `while` is not allowed in a `const`
38+
--> $DIR/loop.rs:40:9
2739
|
2840
LL | while false {}
2941
| ^^^^^^^^^^^^^^
42+
|
43+
= note: for more information, see https://github.com/rust-lang/rust/issues/52000
44+
= help: add `#![feature(const_loop)]` to the crate attributes to enable
3045

31-
error[E0744]: `while` is not allowed in a `const`
32-
--> $DIR/loop.rs:47:5
46+
error[E0658]: `while` is not allowed in a `const`
47+
--> $DIR/loop.rs:49:5
3348
|
3449
LL | / while x < 4 {
3550
LL | | x += 1;
3651
LL | | }
3752
| |_____^
53+
|
54+
= note: for more information, see https://github.com/rust-lang/rust/issues/52000
55+
= help: add `#![feature(const_loop)]` to the crate attributes to enable
3856

39-
error[E0744]: `while` is not allowed in a `const`
40-
--> $DIR/loop.rs:51:5
57+
error[E0658]: `while` is not allowed in a `const`
58+
--> $DIR/loop.rs:53:5
4159
|
4260
LL | / while x < 8 {
4361
LL | | x += 1;
4462
LL | | }
4563
| |_____^
64+
|
65+
= note: for more information, see https://github.com/rust-lang/rust/issues/52000
66+
= help: add `#![feature(const_loop)]` to the crate attributes to enable
4667

4768
error[E0744]: `for` is not allowed in a `const`
48-
--> $DIR/loop.rs:61:5
69+
--> $DIR/loop.rs:63:5
4970
|
5071
LL | / for i in 0..4 {
5172
LL | | x += i;
5273
LL | | }
5374
| |_____^
5475

5576
error[E0744]: `for` is not allowed in a `const`
56-
--> $DIR/loop.rs:65:5
77+
--> $DIR/loop.rs:67:5
5778
|
5879
LL | / for i in 0..4 {
5980
LL | | x += i;
6081
LL | | }
6182
| |_____^
6283

63-
error[E0744]: `loop` is not allowed in a `const`
64-
--> $DIR/loop.rs:75:5
84+
error[E0658]: `loop` is not allowed in a `const`
85+
--> $DIR/loop.rs:77:5
6586
|
6687
LL | / loop {
6788
LL | | x += 1;
@@ -70,9 +91,12 @@ LL | | break;
7091
LL | | }
7192
LL | | }
7293
| |_____^
94+
|
95+
= note: for more information, see https://github.com/rust-lang/rust/issues/52000
96+
= help: add `#![feature(const_loop)]` to the crate attributes to enable
7397

74-
error[E0744]: `loop` is not allowed in a `const`
75-
--> $DIR/loop.rs:82:5
98+
error[E0658]: `loop` is not allowed in a `const`
99+
--> $DIR/loop.rs:84:5
76100
|
77101
LL | / loop {
78102
LL | | x += 1;
@@ -81,31 +105,47 @@ LL | | break;
81105
LL | | }
82106
LL | | }
83107
| |_____^
108+
|
109+
= note: for more information, see https://github.com/rust-lang/rust/issues/52000
110+
= help: add `#![feature(const_loop)]` to the crate attributes to enable
84111

85-
error[E0744]: `while` is not allowed in a `const`
86-
--> $DIR/loop.rs:94:5
112+
error[E0658]: `while` is not allowed in a `const`
113+
--> $DIR/loop.rs:96:5
87114
|
88115
LL | while let None = Some(x) { }
89116
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
117+
|
118+
= note: for more information, see https://github.com/rust-lang/rust/issues/52000
119+
= help: add `#![feature(const_loop)]` to the crate attributes to enable
90120

91-
error[E0744]: `while` is not allowed in a `const`
92-
--> $DIR/loop.rs:95:5
121+
error[E0658]: `while` is not allowed in a `const`
122+
--> $DIR/loop.rs:97:5
93123
|
94124
LL | while let None = Some(x) { }
95125
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
126+
|
127+
= note: for more information, see https://github.com/rust-lang/rust/issues/52000
128+
= help: add `#![feature(const_loop)]` to the crate attributes to enable
96129

97-
error[E0744]: `loop` is not allowed in a `const`
98-
--> $DIR/loop.rs:17:22
130+
error[E0658]: `loop` is not allowed in a `const`
131+
--> $DIR/loop.rs:19:22
99132
|
100133
LL | const BAR: i32 = loop { break 4; };
101134
| ^^^^^^^^^^^^^^^^^
135+
|
136+
= note: for more information, see https://github.com/rust-lang/rust/issues/52000
137+
= help: add `#![feature(const_loop)]` to the crate attributes to enable
102138

103-
error[E0744]: `loop` is not allowed in a `const`
104-
--> $DIR/loop.rs:21:22
139+
error[E0658]: `loop` is not allowed in a `const`
140+
--> $DIR/loop.rs:23:22
105141
|
106142
LL | const BAR: i32 = loop { break 4; };
107143
| ^^^^^^^^^^^^^^^^^
144+
|
145+
= note: for more information, see https://github.com/rust-lang/rust/issues/52000
146+
= help: add `#![feature(const_loop)]` to the crate attributes to enable
108147

109148
error: aborting due to 15 previous errors
110149

111-
For more information about this error, try `rustc --explain E0744`.
150+
Some errors have detailed explanations: E0658, E0744.
151+
For more information about an error, try `rustc --explain E0658`.
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
error[E0658]: `while` is not allowed in a `const`
2+
--> $DIR/loop.rs:40:9
3+
|
4+
LL | while false {}
5+
| ^^^^^^^^^^^^^^
6+
|
7+
= note: for more information, see https://github.com/rust-lang/rust/issues/49146
8+
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
9+
= note: `#![feature(const_loop)]` alone is not sufficient, since this loop expression contains an implicit conditional
10+
11+
error[E0658]: `while` is not allowed in a `const`
12+
--> $DIR/loop.rs:49:5
13+
|
14+
LL | / while x < 4 {
15+
LL | | x += 1;
16+
LL | | }
17+
| |_____^
18+
|
19+
= note: for more information, see https://github.com/rust-lang/rust/issues/49146
20+
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
21+
= note: `#![feature(const_loop)]` alone is not sufficient, since this loop expression contains an implicit conditional
22+
23+
error[E0658]: `while` is not allowed in a `const`
24+
--> $DIR/loop.rs:53:5
25+
|
26+
LL | / while x < 8 {
27+
LL | | x += 1;
28+
LL | | }
29+
| |_____^
30+
|
31+
= note: for more information, see https://github.com/rust-lang/rust/issues/49146
32+
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
33+
= note: `#![feature(const_loop)]` alone is not sufficient, since this loop expression contains an implicit conditional
34+
35+
error[E0744]: `for` is not allowed in a `const`
36+
--> $DIR/loop.rs:63:5
37+
|
38+
LL | / for i in 0..4 {
39+
LL | | x += i;
40+
LL | | }
41+
| |_____^
42+
43+
error[E0744]: `for` is not allowed in a `const`
44+
--> $DIR/loop.rs:67:5
45+
|
46+
LL | / for i in 0..4 {
47+
LL | | x += i;
48+
LL | | }
49+
| |_____^
50+
51+
error[E0658]: `if` is not allowed in a `const`
52+
--> $DIR/loop.rs:79:9
53+
|
54+
LL | / if x == 4 {
55+
LL | | break;
56+
LL | | }
57+
| |_________^
58+
|
59+
= note: for more information, see https://github.com/rust-lang/rust/issues/49146
60+
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
61+
62+
error[E0658]: `if` is not allowed in a `const`
63+
--> $DIR/loop.rs:86:9
64+
|
65+
LL | / if x == 8 {
66+
LL | | break;
67+
LL | | }
68+
| |_________^
69+
|
70+
= note: for more information, see https://github.com/rust-lang/rust/issues/49146
71+
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
72+
73+
error[E0658]: `while` is not allowed in a `const`
74+
--> $DIR/loop.rs:96:5
75+
|
76+
LL | while let None = Some(x) { }
77+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
78+
|
79+
= note: for more information, see https://github.com/rust-lang/rust/issues/49146
80+
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
81+
= note: `#![feature(const_loop)]` alone is not sufficient, since this loop expression contains an implicit conditional
82+
83+
error[E0658]: `while` is not allowed in a `const`
84+
--> $DIR/loop.rs:97:5
85+
|
86+
LL | while let None = Some(x) { }
87+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
88+
|
89+
= note: for more information, see https://github.com/rust-lang/rust/issues/49146
90+
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
91+
= note: `#![feature(const_loop)]` alone is not sufficient, since this loop expression contains an implicit conditional
92+
93+
error: aborting due to 9 previous errors
94+
95+
Some errors have detailed explanations: E0658, E0744.
96+
For more information about an error, try `rustc --explain E0658`.

0 commit comments

Comments
 (0)