]> git.lizzy.rs Git - rust.git/blob - src/test/ui/static/static-drop-scope.stderr
Rollup merge of #106043 - c410-f3r:moar-errors, r=petrochenkov
[rust.git] / src / test / ui / static / static-drop-scope.stderr
1 error[E0493]: destructor of `WithDtor` cannot be evaluated at compile-time
2   --> $DIR/static-drop-scope.rs:7:60
3    |
4 LL | static PROMOTION_FAIL_S: Option<&'static WithDtor> = Some(&WithDtor);
5    |                                                            ^^^^^^^^- value is dropped here
6    |                                                            |
7    |                                                            the destructor for this type cannot be evaluated in statics
8
9 error[E0716]: temporary value dropped while borrowed
10   --> $DIR/static-drop-scope.rs:7:60
11    |
12 LL | static PROMOTION_FAIL_S: Option<&'static WithDtor> = Some(&WithDtor);
13    |                                                      ------^^^^^^^^-
14    |                                                      |     |       |
15    |                                                      |     |       temporary value is freed at the end of this statement
16    |                                                      |     creates a temporary value which is freed while still in use
17    |                                                      using this value as a static requires that borrow lasts for `'static`
18
19 error[E0493]: destructor of `WithDtor` cannot be evaluated at compile-time
20   --> $DIR/static-drop-scope.rs:11:59
21    |
22 LL | const PROMOTION_FAIL_C: Option<&'static WithDtor> = Some(&WithDtor);
23    |                                                           ^^^^^^^^- value is dropped here
24    |                                                           |
25    |                                                           the destructor for this type cannot be evaluated in constants
26
27 error[E0716]: temporary value dropped while borrowed
28   --> $DIR/static-drop-scope.rs:11:59
29    |
30 LL | const PROMOTION_FAIL_C: Option<&'static WithDtor> = Some(&WithDtor);
31    |                                                     ------^^^^^^^^-
32    |                                                     |     |       |
33    |                                                     |     |       temporary value is freed at the end of this statement
34    |                                                     |     creates a temporary value which is freed while still in use
35    |                                                     using this value as a constant requires that borrow lasts for `'static`
36
37 error[E0493]: destructor of `(WithDtor, i32)` cannot be evaluated at compile-time
38   --> $DIR/static-drop-scope.rs:15:28
39    |
40 LL | static EARLY_DROP_S: i32 = (WithDtor, 0).1;
41    |                            ^^^^^^^^^^^^^ - value is dropped here
42    |                            |
43    |                            the destructor for this type cannot be evaluated in statics
44
45 error[E0493]: destructor of `(WithDtor, i32)` cannot be evaluated at compile-time
46   --> $DIR/static-drop-scope.rs:18:27
47    |
48 LL | const EARLY_DROP_C: i32 = (WithDtor, 0).1;
49    |                           ^^^^^^^^^^^^^ - value is dropped here
50    |                           |
51    |                           the destructor for this type cannot be evaluated in constants
52
53 error[E0493]: destructor of `T` cannot be evaluated at compile-time
54   --> $DIR/static-drop-scope.rs:21:24
55    |
56 LL | const fn const_drop<T>(_: T) {}
57    |                        ^      - value is dropped here
58    |                        |
59    |                        the destructor for this type cannot be evaluated in constant functions
60
61 error[E0493]: destructor of `(T, ())` cannot be evaluated at compile-time
62   --> $DIR/static-drop-scope.rs:25:5
63    |
64 LL |     (x, ()).1
65    |     ^^^^^^^ the destructor for this type cannot be evaluated in constant functions
66 LL |
67 LL | }
68    | - value is dropped here
69
70 error[E0493]: destructor of `(Option<WithDtor>, i32)` cannot be evaluated at compile-time
71   --> $DIR/static-drop-scope.rs:29:34
72    |
73 LL | const EARLY_DROP_C_OPTION: i32 = (Some(WithDtor), 0).1;
74    |                                  ^^^^^^^^^^^^^^^^^^^ - value is dropped here
75    |                                  |
76    |                                  the destructor for this type cannot be evaluated in constants
77
78 error[E0493]: destructor of `(Option<WithDtor>, i32)` cannot be evaluated at compile-time
79   --> $DIR/static-drop-scope.rs:34:43
80    |
81 LL | const EARLY_DROP_C_OPTION_CONSTANT: i32 = (HELPER, 0).1;
82    |                                           ^^^^^^^^^^^ - value is dropped here
83    |                                           |
84    |                                           the destructor for this type cannot be evaluated in constants
85
86 error: aborting due to 10 previous errors
87
88 Some errors have detailed explanations: E0493, E0716.
89 For more information about an error, try `rustc --explain E0493`.