Skip to content

Commit 9355168

Browse files
author
Christian Poveda
committed
update tests
1 parent e75fbae commit 9355168

11 files changed

+107
-17
lines changed

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ LL | ..SafeStruct{field1: SafeEnum::Va
55
| ___________________________________________^
66
LL | |
77
LL | | field2: SafeEnum::Variant1}};
8-
| |________________________________________________________________________________^ statics cannot evaluate destructors
8+
| | ^- value is dropped here
9+
| |________________________________________________________________________________|
10+
| statics cannot evaluate destructors
911

1012
error[E0010]: allocations are not allowed in statics
1113
--> $DIR/check-static-values-constraints.rs:79:33

src/test/ui/consts/const-eval/const_let.stderr

+12-4
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,33 @@ error[E0493]: destructors cannot be evaluated at compile-time
22
--> $DIR/const_let.rs:16:32
33
|
44
LL | const Y: FakeNeedsDrop = { let mut x = FakeNeedsDrop; x = FakeNeedsDrop; x };
5-
| ^^^^^ constants cannot evaluate destructors
5+
| ^^^^^ - value is dropped here
6+
| |
7+
| constants cannot evaluate destructors
68

79
error[E0493]: destructors cannot be evaluated at compile-time
810
--> $DIR/const_let.rs:20:33
911
|
1012
LL | const Y2: FakeNeedsDrop = { let mut x; x = FakeNeedsDrop; x = FakeNeedsDrop; x };
11-
| ^^^^^ constants cannot evaluate destructors
13+
| ^^^^^ - value is dropped here
14+
| |
15+
| constants cannot evaluate destructors
1216

1317
error[E0493]: destructors cannot be evaluated at compile-time
1418
--> $DIR/const_let.rs:24:21
1519
|
1620
LL | const Z: () = { let mut x = None; x = Some(FakeNeedsDrop); };
17-
| ^^^^^ constants cannot evaluate destructors
21+
| ^^^^^ - value is dropped here
22+
| |
23+
| constants cannot evaluate destructors
1824

1925
error[E0493]: destructors cannot be evaluated at compile-time
2026
--> $DIR/const_let.rs:28:22
2127
|
2228
LL | const Z2: () = { let mut x; x = None; x = Some(FakeNeedsDrop); };
23-
| ^^^^^ constants cannot evaluate destructors
29+
| ^^^^^ - value is dropped here
30+
| |
31+
| constants cannot evaluate destructors
2432

2533
error: aborting due to 4 previous errors
2634

src/test/ui/consts/const-eval/issue-65394.stderr

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ error[E0493]: destructors cannot be evaluated at compile-time
1212
|
1313
LL | let mut x = Vec::<i32>::new();
1414
| ^^^^^ constants cannot evaluate destructors
15+
...
16+
LL | };
17+
| - value is dropped here
1518

1619
error: aborting due to 2 previous errors
1720

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#![feature(const_if_match)]
2+
#![feature(const_loop)]
3+
4+
const _: Option<Vec<i32>> = {
5+
let mut never_returned = Some(Vec::new());
6+
let mut always_returned = None; //~ ERROR destructors cannot be evaluated at compile-time
7+
8+
let mut i = 0;
9+
loop {
10+
always_returned = never_returned;
11+
never_returned = None;
12+
13+
i += 1;
14+
if i == 10 {
15+
break always_returned;
16+
}
17+
}
18+
};
19+
20+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
error[E0493]: destructors cannot be evaluated at compile-time
2+
--> $DIR/livedrop.rs:6:9
3+
|
4+
LL | let mut always_returned = None;
5+
| ^^^^^^^^^^^^^^^^^^^ constants cannot evaluate destructors
6+
...
7+
LL | always_returned = never_returned;
8+
| --------------- value is dropped here
9+
10+
error: aborting due to previous error
11+
12+
For more information about this error, try `rustc --explain E0493`.

src/test/ui/consts/control-flow/drop-fail.stock.stderr

+12
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,36 @@ error[E0493]: destructors cannot be evaluated at compile-time
33
|
44
LL | let x = Some(Vec::new());
55
| ^ constants cannot evaluate destructors
6+
...
7+
LL | };
8+
| - value is dropped here
69

710
error[E0493]: destructors cannot be evaluated at compile-time
811
--> $DIR/drop-fail.rs:23:9
912
|
1013
LL | let vec_tuple = (Vec::new(),);
1114
| ^^^^^^^^^ constants cannot evaluate destructors
15+
...
16+
LL | };
17+
| - value is dropped here
1218

1319
error[E0493]: destructors cannot be evaluated at compile-time
1420
--> $DIR/drop-fail.rs:31:9
1521
|
1622
LL | let x: Result<_, Vec<i32>> = Ok(Vec::new());
1723
| ^ constants cannot evaluate destructors
24+
...
25+
LL | };
26+
| - value is dropped here
1827

1928
error[E0493]: destructors cannot be evaluated at compile-time
2029
--> $DIR/drop-fail.rs:41:9
2130
|
2231
LL | let mut tmp = None;
2332
| ^^^^^^^ constants cannot evaluate destructors
33+
...
34+
LL | };
35+
| - value is dropped here
2436

2537
error: aborting due to 4 previous errors
2638

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

+9-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ error[E0493]: destructors cannot be evaluated at compile-time
22
--> $DIR/min_const_fn.rs:37:25
33
|
44
LL | const fn into_inner(self) -> T { self.0 }
5-
| ^^^^ constant functions cannot evaluate destructors
5+
| ^^^^ - value is dropped here
6+
| |
7+
| constant functions cannot evaluate destructors
68

79
error[E0723]: mutable references in const fn are unstable
810
--> $DIR/min_const_fn.rs:39:36
@@ -17,7 +19,9 @@ error[E0493]: destructors cannot be evaluated at compile-time
1719
--> $DIR/min_const_fn.rs:44:28
1820
|
1921
LL | const fn into_inner_lt(self) -> T { self.0 }
20-
| ^^^^ constant functions cannot evaluate destructors
22+
| ^^^^ - value is dropped here
23+
| |
24+
| constant functions cannot evaluate destructors
2125

2226
error[E0723]: mutable references in const fn are unstable
2327
--> $DIR/min_const_fn.rs:46:42
@@ -32,7 +36,9 @@ error[E0493]: destructors cannot be evaluated at compile-time
3236
--> $DIR/min_const_fn.rs:51:27
3337
|
3438
LL | const fn into_inner_s(self) -> T { self.0 }
35-
| ^^^^ constant functions cannot evaluate destructors
39+
| ^^^^ - value is dropped here
40+
| |
41+
| constant functions cannot evaluate destructors
3642

3743
error[E0723]: mutable references in const fn are unstable
3844
--> $DIR/min_const_fn.rs:53:38

src/test/ui/consts/miri_unleashed/feature-gate-unleash_the_miri_inside_of_you.stderr

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ error[E0493]: destructors cannot be evaluated at compile-time
22
--> $DIR/feature-gate-unleash_the_miri_inside_of_you.rs:11:20
33
|
44
LL | const F: u32 = (U::X, 42).1;
5-
| ^^^^^^^^^^ constants cannot evaluate destructors
5+
| ^^^^^^^^^^ - value is dropped here
6+
| |
7+
| constants cannot evaluate destructors
68

79
error: aborting due to previous error
810

src/test/ui/consts/unstable-const-fn-in-libcore.stderr

+6
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,18 @@ error[E0493]: destructors cannot be evaluated at compile-time
99
|
1010
LL | const fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T {
1111
| ^ constant functions cannot evaluate destructors
12+
...
13+
LL | }
14+
| - value is dropped here
1215

1316
error[E0493]: destructors cannot be evaluated at compile-time
1417
--> $DIR/unstable-const-fn-in-libcore.rs:19:47
1518
|
1619
LL | const fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T {
1720
| ^^^^ constant functions cannot evaluate destructors
21+
...
22+
LL | }
23+
| - value is dropped here
1824

1925
error: aborting due to 3 previous errors
2026

src/test/ui/span/E0493.stderr

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ error[E0493]: destructors cannot be evaluated at compile-time
22
--> $DIR/E0493.rs:17:17
33
|
44
LL | const F : Foo = (Foo { a : 0 }, Foo { a : 1 }).1;
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constants cannot evaluate destructors
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - value is dropped here
6+
| |
7+
| constants cannot evaluate destructors
68

79
error: aborting due to previous error
810

src/test/ui/static/static-drop-scope.stderr

+24-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ error[E0493]: destructors cannot be evaluated at compile-time
22
--> $DIR/static-drop-scope.rs:9:60
33
|
44
LL | static PROMOTION_FAIL_S: Option<&'static WithDtor> = Some(&WithDtor);
5-
| ^^^^^^^^ statics cannot evaluate destructors
5+
| ^^^^^^^^- value is dropped here
6+
| |
7+
| statics cannot evaluate destructors
68

79
error[E0716]: temporary value dropped while borrowed
810
--> $DIR/static-drop-scope.rs:9:60
@@ -18,7 +20,9 @@ error[E0493]: destructors cannot be evaluated at compile-time
1820
--> $DIR/static-drop-scope.rs:13:59
1921
|
2022
LL | const PROMOTION_FAIL_C: Option<&'static WithDtor> = Some(&WithDtor);
21-
| ^^^^^^^^ constants cannot evaluate destructors
23+
| ^^^^^^^^- value is dropped here
24+
| |
25+
| constants cannot evaluate destructors
2226

2327
error[E0716]: temporary value dropped while borrowed
2428
--> $DIR/static-drop-scope.rs:13:59
@@ -34,37 +38,50 @@ error[E0493]: destructors cannot be evaluated at compile-time
3438
--> $DIR/static-drop-scope.rs:17:28
3539
|
3640
LL | static EARLY_DROP_S: i32 = (WithDtor, 0).1;
37-
| ^^^^^^^^^^^^^ statics cannot evaluate destructors
41+
| ^^^^^^^^^^^^^ - value is dropped here
42+
| |
43+
| statics cannot evaluate destructors
3844

3945
error[E0493]: destructors cannot be evaluated at compile-time
4046
--> $DIR/static-drop-scope.rs:20:27
4147
|
4248
LL | const EARLY_DROP_C: i32 = (WithDtor, 0).1;
43-
| ^^^^^^^^^^^^^ constants cannot evaluate destructors
49+
| ^^^^^^^^^^^^^ - value is dropped here
50+
| |
51+
| constants cannot evaluate destructors
4452

4553
error[E0493]: destructors cannot be evaluated at compile-time
4654
--> $DIR/static-drop-scope.rs:23:24
4755
|
4856
LL | const fn const_drop<T>(_: T) {}
49-
| ^ constant functions cannot evaluate destructors
57+
| ^ - value is dropped here
58+
| |
59+
| constant functions cannot evaluate destructors
5060

5161
error[E0493]: destructors cannot be evaluated at compile-time
5262
--> $DIR/static-drop-scope.rs:27:5
5363
|
5464
LL | (x, ()).1
5565
| ^^^^^^^ constant functions cannot evaluate destructors
66+
LL |
67+
LL | }
68+
| - value is dropped here
5669

5770
error[E0493]: destructors cannot be evaluated at compile-time
5871
--> $DIR/static-drop-scope.rs:31:34
5972
|
6073
LL | const EARLY_DROP_C_OPTION: i32 = (Some(WithDtor), 0).1;
61-
| ^^^^^^^^^^^^^^^^^^^ constants cannot evaluate destructors
74+
| ^^^^^^^^^^^^^^^^^^^ - value is dropped here
75+
| |
76+
| constants cannot evaluate destructors
6277

6378
error[E0493]: destructors cannot be evaluated at compile-time
6479
--> $DIR/static-drop-scope.rs:36:43
6580
|
6681
LL | const EARLY_DROP_C_OPTION_CONSTANT: i32 = (HELPER, 0).1;
67-
| ^^^^^^^^^^^ constants cannot evaluate destructors
82+
| ^^^^^^^^^^^ - value is dropped here
83+
| |
84+
| constants cannot evaluate destructors
6885

6986
error: aborting due to 10 previous errors
7087

0 commit comments

Comments
 (0)