1
+ // revisions: stock precise
2
+
1
3
#![ feature( const_if_match) ]
2
4
#![ feature( const_loop) ]
5
+ #![ cfg_attr( precise, feature( const_precise_live_drops) ) ]
3
6
4
- // `x` is *not* always moved into the final value may be dropped inside the initializer.
7
+ // `x` is *not* always moved into the final value and may be dropped inside the initializer.
5
8
const _: Option < Vec < i32 > > = {
6
9
let y: Option < Vec < i32 > > = None ;
7
10
let x = Some ( Vec :: new ( ) ) ;
8
- //~^ ERROR destructors cannot be evaluated at compile-time
11
+ //[stock,precise] ~^ ERROR destructors cannot be evaluated at compile-time
9
12
10
13
if true {
11
14
x
@@ -18,15 +21,15 @@ const _: Option<Vec<i32>> = {
18
21
// existing analysis.
19
22
const _: Vec < i32 > = {
20
23
let vec_tuple = ( Vec :: new ( ) , ) ;
21
- //~^ ERROR destructors cannot be evaluated at compile-time
24
+ //[stock] ~^ ERROR destructors cannot be evaluated at compile-time
22
25
23
26
vec_tuple. 0
24
27
} ;
25
28
26
29
// This applies to single-field enum variants as well.
27
30
const _: Vec < i32 > = {
28
31
let x: Result < _ , Vec < i32 > > = Ok ( Vec :: new ( ) ) ;
29
- //~^ ERROR destructors cannot be evaluated at compile-time
32
+ //[stock] ~^ ERROR destructors cannot be evaluated at compile-time
30
33
31
34
match x {
32
35
Ok ( x) | Err ( x) => x,
@@ -36,7 +39,7 @@ const _: Vec<i32> = {
36
39
const _: Option < Vec < i32 > > = {
37
40
let mut some = Some ( Vec :: new ( ) ) ;
38
41
let mut tmp = None ;
39
- //~^ ERROR destructors cannot be evaluated at compile-time
42
+ //[stock,precise] ~^ ERROR destructors cannot be evaluated at compile-time
40
43
41
44
let mut i = 0 ;
42
45
while i < 10 {
0 commit comments