]> git.lizzy.rs Git - rust.git/blob - tests/ui/check-static-values-constraints.stderr
Bless updated output from print-type-sizes tests.
[rust.git] / tests / ui / check-static-values-constraints.stderr
1 error[E0493]: destructor of `SafeStruct` 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    |                                                                                  the destructor for this type cannot be evaluated in statics
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    = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
26    = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
27
28 error[E0010]: allocations are not allowed in statics
29   --> $DIR/check-static-values-constraints.rs:94:5
30    |
31 LL |     box MyOwned,
32    |     ^^^^^^^^^^^ allocation not allowed in statics
33
34 error[E0010]: allocations are not allowed in statics
35   --> $DIR/check-static-values-constraints.rs:95:5
36    |
37 LL |     box MyOwned,
38    |     ^^^^^^^^^^^ allocation not allowed in statics
39
40 error[E0010]: allocations are not allowed in statics
41   --> $DIR/check-static-values-constraints.rs:99:6
42    |
43 LL |     &box MyOwned,
44    |      ^^^^^^^^^^^ allocation not allowed in statics
45
46 error[E0010]: allocations are not allowed in statics
47   --> $DIR/check-static-values-constraints.rs:100:6
48    |
49 LL |     &box MyOwned,
50    |      ^^^^^^^^^^^ allocation not allowed in statics
51
52 error[E0010]: allocations are not allowed in statics
53   --> $DIR/check-static-values-constraints.rs:106:5
54    |
55 LL |     box 3;
56    |     ^^^^^ allocation not allowed in statics
57
58 error[E0507]: cannot move out of static item `x`
59   --> $DIR/check-static-values-constraints.rs:110:45
60    |
61 LL |     let y = { static x: Box<isize> = box 3; x };
62    |                                             ^ move occurs because `x` has type `Box<isize>`, which does not implement the `Copy` trait
63    |
64 help: consider borrowing here
65    |
66 LL |     let y = { static x: Box<isize> = box 3; &x };
67    |                                             +
68
69 error[E0010]: allocations are not allowed in statics
70   --> $DIR/check-static-values-constraints.rs:110:38
71    |
72 LL |     let y = { static x: Box<isize> = box 3; x };
73    |                                      ^^^^^ allocation not allowed in statics
74
75 error: aborting due to 10 previous errors
76
77 Some errors have detailed explanations: E0010, E0015, E0493, E0507.
78 For more information about an error, try `rustc --explain E0010`.