]> git.lizzy.rs Git - rust.git/blob - src/test/ui/check-static-values-constraints.stderr
Auto merge of #99028 - tmiasko:inline, r=estebank
[rust.git] / src / test / ui / check-static-values-constraints.stderr
1 error[E0493]: destructors cannot be evaluated at compile-time
2   --> $DIR/check-static-values-constraints.rs:65:43
3    |
4 LL |                                           ..SafeStruct{field1: SafeEnum::Variant3(WithDtor),
5    |  ___________________________________________^
6 LL | |
7 LL | |                                                      field2: SafeEnum::Variant1}};
8    | |                                                                                ^- value is dropped here
9    | |________________________________________________________________________________|
10    |                                                                                  statics cannot evaluate destructors
11
12 error[E0010]: allocations are not allowed in statics
13   --> $DIR/check-static-values-constraints.rs:79:33
14    |
15 LL | static STATIC11: Box<MyOwned> = box MyOwned;
16    |                                 ^^^^^^^^^^^ allocation not allowed in statics
17
18 error[E0015]: cannot call non-const fn `<str as ToString>::to_string` in statics
19   --> $DIR/check-static-values-constraints.rs:89:38
20    |
21 LL |     field2: SafeEnum::Variant4("str".to_string())
22    |                                      ^^^^^^^^^^^
23    |
24    = note: calls in statics are limited to constant functions, tuple structs and tuple variants
25
26 error[E0010]: allocations are not allowed in statics
27   --> $DIR/check-static-values-constraints.rs:94:5
28    |
29 LL |     box MyOwned,
30    |     ^^^^^^^^^^^ allocation not allowed in statics
31
32 error[E0010]: allocations are not allowed in statics
33   --> $DIR/check-static-values-constraints.rs:95:5
34    |
35 LL |     box MyOwned,
36    |     ^^^^^^^^^^^ allocation not allowed in statics
37
38 error[E0010]: allocations are not allowed in statics
39   --> $DIR/check-static-values-constraints.rs:99:6
40    |
41 LL |     &box MyOwned,
42    |      ^^^^^^^^^^^ allocation not allowed in statics
43
44 error[E0010]: allocations are not allowed in statics
45   --> $DIR/check-static-values-constraints.rs:100:6
46    |
47 LL |     &box MyOwned,
48    |      ^^^^^^^^^^^ allocation not allowed in statics
49
50 error[E0010]: allocations are not allowed in statics
51   --> $DIR/check-static-values-constraints.rs:106:5
52    |
53 LL |     box 3;
54    |     ^^^^^ allocation not allowed in statics
55
56 error[E0507]: cannot move out of static item `x`
57   --> $DIR/check-static-values-constraints.rs:110:45
58    |
59 LL |     let y = { static x: Box<isize> = box 3; x };
60    |                                             ^
61    |                                             |
62    |                                             move occurs because `x` has type `Box<isize>`, which does not implement the `Copy` trait
63    |                                             help: consider borrowing here: `&x`
64
65 error[E0010]: allocations are not allowed in statics
66   --> $DIR/check-static-values-constraints.rs:110:38
67    |
68 LL |     let y = { static x: Box<isize> = box 3; x };
69    |                                      ^^^^^ allocation not allowed in statics
70
71 error: aborting due to 10 previous errors
72
73 Some errors have detailed explanations: E0010, E0015, E0493, E0507.
74 For more information about an error, try `rustc --explain E0010`.