]>
Commit | Line | Data |
---|---|---|
ea8adc8c XL |
1 | struct WithDtor; |
2 | ||
3 | impl Drop for WithDtor { | |
4 | fn drop(&mut self) {} | |
5 | } | |
6 | ||
7 | static PROMOTION_FAIL_S: Option<&'static WithDtor> = Some(&WithDtor); | |
2b03887a | 8 | //~^ ERROR destructor of |
48663c56 | 9 | //~| ERROR temporary value dropped while borrowed |
ea8adc8c XL |
10 | |
11 | const PROMOTION_FAIL_C: Option<&'static WithDtor> = Some(&WithDtor); | |
2b03887a | 12 | //~^ ERROR destructor of |
48663c56 | 13 | //~| ERROR temporary value dropped while borrowed |
ea8adc8c XL |
14 | |
15 | static EARLY_DROP_S: i32 = (WithDtor, 0).1; | |
2b03887a | 16 | //~^ ERROR destructor of |
ea8adc8c XL |
17 | |
18 | const EARLY_DROP_C: i32 = (WithDtor, 0).1; | |
2b03887a | 19 | //~^ ERROR destructor of |
ea8adc8c | 20 | |
2c00a5a8 | 21 | const fn const_drop<T>(_: T) {} |
2b03887a | 22 | //~^ ERROR destructor of |
2c00a5a8 XL |
23 | |
24 | const fn const_drop2<T>(x: T) { | |
25 | (x, ()).1 | |
2b03887a | 26 | //~^ ERROR destructor of |
2c00a5a8 XL |
27 | } |
28 | ||
9fa01778 | 29 | const EARLY_DROP_C_OPTION: i32 = (Some(WithDtor), 0).1; |
2b03887a | 30 | //~^ ERROR destructor of |
9fa01778 XL |
31 | |
32 | const HELPER: Option<WithDtor> = Some(WithDtor); | |
33 | ||
34 | const EARLY_DROP_C_OPTION_CONSTANT: i32 = (HELPER, 0).1; | |
2b03887a | 35 | //~^ ERROR destructor of |
9fa01778 | 36 | |
ea8adc8c | 37 | fn main () {} |