File tree Expand file tree Collapse file tree 3 files changed +34
-2
lines changed Expand file tree Collapse file tree 3 files changed +34
-2
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,19 @@ error[E0493]: destructors cannot be evaluated at compile-time
5454LL | (x, ()).1
5555 | ^^^^^^^ constant functions cannot evaluate destructors
5656
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
5870
5971Some errors occurred: E0493, E0716.
6072For more information about an error, try `rustc --explain E0493`.
Original file line number Diff line number Diff line change @@ -28,4 +28,12 @@ const fn const_drop2<T>(x: T) {
2828 //~^ ERROR destructors cannot be evaluated at compile-time
2929}
3030
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+
3139fn main ( ) { }
Original file line number Diff line number Diff line change @@ -54,7 +54,19 @@ error[E0493]: destructors cannot be evaluated at compile-time
5454LL | (x, ()).1
5555 | ^^^^^^^ constant functions cannot evaluate destructors
5656
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
5870
5971Some errors occurred: E0493, E0597.
6072For more information about an error, try `rustc --explain E0493`.
You can’t perform that action at this time.
0 commit comments