File tree 2 files changed +21
-1
lines changed
2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -28,4 +28,12 @@ const fn const_drop2<T>(x: T) {
28
28
//~^ ERROR destructors cannot be evaluated at compile-time
29
29
}
30
30
31
+ const EARLY_DROP_C_OPTION : i32 = ( Some ( WithDtor ) , 0 ) . 1 ;
32
+ //~^ ERROR destructors cannot be evaluated at compile-time
33
+
34
+ const HELPER : Option < WithDtor > = Some ( WithDtor ) ;
35
+
36
+ const EARLY_DROP_C_OPTION_CONSTANT : i32 = ( HELPER , 0 ) . 1 ;
37
+ //~^ ERROR destructors cannot be evaluated at compile-time
38
+
31
39
fn main ( ) { }
Original file line number Diff line number Diff line change @@ -54,7 +54,19 @@ error[E0493]: destructors cannot be evaluated at compile-time
54
54
LL | (x, ()).1
55
55
| ^^^^^^^ constant functions cannot evaluate destructors
56
56
57
- error: aborting due to 8 previous errors
57
+ error[E0493]: destructors cannot be evaluated at compile-time
58
+ --> $DIR/static-drop-scope.rs:31:34
59
+ |
60
+ LL | const EARLY_DROP_C_OPTION: i32 = (Some(WithDtor), 0).1;
61
+ | ^^^^^^^^^^^^^^^^^^^ constants cannot evaluate destructors
62
+
63
+ error[E0493]: destructors cannot be evaluated at compile-time
64
+ --> $DIR/static-drop-scope.rs:36:43
65
+ |
66
+ LL | const EARLY_DROP_C_OPTION_CONSTANT: i32 = (HELPER, 0).1;
67
+ | ^^^^^^^^^^^ constants cannot evaluate destructors
68
+
69
+ error: aborting due to 10 previous errors
58
70
59
71
Some errors occurred: E0493, E0597.
60
72
For more information about an error, try `rustc --explain E0493`.
You can’t perform that action at this time.
0 commit comments