fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #71365 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4fb7144ed15

1.43.0
3.4 KiB72 linesraw
1error[E0493]: destructors cannot be evaluated at compile-time
2  --> $DIR/static-drop-scope.rs:9:60
3   |
4LL | static PROMOTION_FAIL_S: Option<&'static WithDtor> = Some(&WithDtor);
5   |                                                            ^^^^^^^^ statics cannot evaluate destructors
6
7error[E0716]: temporary value dropped while borrowed
8  --> $DIR/static-drop-scope.rs:9:60
9   |
10LL | static PROMOTION_FAIL_S: Option<&'static WithDtor> = Some(&WithDtor);
11   |                                                      ------^^^^^^^^-
12   |                                                      |     |       |
13   |                                                      |     |       temporary value is freed at the end of this statement
14   |                                                      |     creates a temporary which is freed while still in use
15   |                                                      using this value as a static requires that borrow lasts for `'static`
16
17error[E0493]: destructors cannot be evaluated at compile-time
18  --> $DIR/static-drop-scope.rs:13:59
19   |
20LL | const PROMOTION_FAIL_C: Option<&'static WithDtor> = Some(&WithDtor);
21   |                                                           ^^^^^^^^ constants cannot evaluate destructors
22
23error[E0716]: temporary value dropped while borrowed
24  --> $DIR/static-drop-scope.rs:13:59
25   |
26LL | const PROMOTION_FAIL_C: Option<&'static WithDtor> = Some(&WithDtor);
27   |                                                     ------^^^^^^^^-
28   |                                                     |     |       |
29   |                                                     |     |       temporary value is freed at the end of this statement
30   |                                                     |     creates a temporary which is freed while still in use
31   |                                                     using this value as a constant requires that borrow lasts for `'static`
32
33error[E0493]: destructors cannot be evaluated at compile-time
34  --> $DIR/static-drop-scope.rs:17:28
35   |
36LL | static EARLY_DROP_S: i32 = (WithDtor, 0).1;
37   |                            ^^^^^^^^^^^^^ statics cannot evaluate destructors
38
39error[E0493]: destructors cannot be evaluated at compile-time
40  --> $DIR/static-drop-scope.rs:20:27
41   |
42LL | const EARLY_DROP_C: i32 = (WithDtor, 0).1;
43   |                           ^^^^^^^^^^^^^ constants cannot evaluate destructors
44
45error[E0493]: destructors cannot be evaluated at compile-time
46  --> $DIR/static-drop-scope.rs:23:24
47   |
48LL | const fn const_drop<T>(_: T) {}
49   |                        ^ constant functions cannot evaluate destructors
50
51error[E0493]: destructors cannot be evaluated at compile-time
52  --> $DIR/static-drop-scope.rs:27:5
53   |
54LL |     (x, ()).1
55   |     ^^^^^^^ constant functions cannot evaluate destructors
56
57error[E0493]: destructors cannot be evaluated at compile-time
58  --> $DIR/static-drop-scope.rs:31:34
59   |
60LL | const EARLY_DROP_C_OPTION: i32 = (Some(WithDtor), 0).1;
61   |                                  ^^^^^^^^^^^^^^^^^^^ constants cannot evaluate destructors
62
63error[E0493]: destructors cannot be evaluated at compile-time
64  --> $DIR/static-drop-scope.rs:36:43
65   |
66LL | const EARLY_DROP_C_OPTION_CONSTANT: i32 = (HELPER, 0).1;
67   |                                           ^^^^^^^^^^^ constants cannot evaluate destructors
68
69error: aborting due to 10 previous errors
70
71Some errors have detailed explanations: E0493, E0716.
72For more information about an error, try `rustc --explain E0493`.