fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
7.6 KiB164 linesraw
1error[E0493]: destructor of `SafeStruct` cannot be evaluated at compile-time
2  --> $DIR/check-static-values-constraints.rs:64:7
3   |
4LL |       ..SafeStruct {
5   |  _______^
6LL | |
7LL | |         field1: SafeEnum::Variant3(WithDtor),
8LL | |         field2: SafeEnum::Variant1,
9LL | |     }
10   | |_____^ the destructor for this type cannot be evaluated in statics
11LL |   };
12   |   - value is dropped here
13
14error[E0010]: allocations are not allowed in statics
15  --> $DIR/check-static-values-constraints.rs:81:33
16   |
17LL | static STATIC11: Vec<MyOwned> = vec![MyOwned];
18   |                                 ^^^^^^^^^^^^^ allocation not allowed in statics
19   |
20   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
21
22error[E0015]: cannot call non-const fn `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics
23  --> $DIR/check-static-values-constraints.rs:81:33
24   |
25LL | static STATIC11: Vec<MyOwned> = vec![MyOwned];
26   |                                 ^^^^^^^^^^^^^
27   |
28   = note: calls in statics are limited to constant functions, tuple structs and tuple variants
29   = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
30   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
31
32error[E0015]: cannot call non-const fn `<str as ToString>::to_string` in statics
33  --> $DIR/check-static-values-constraints.rs:92:38
34   |
35LL |     field2: SafeEnum::Variant4("str".to_string()),
36   |                                      ^^^^^^^^^^^
37   |
38   = note: calls in statics are limited to constant functions, tuple structs and tuple variants
39   = help: add `#![feature(const_trait_impl)]` to the crate attributes to enable
40   = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
41
42error[E0010]: allocations are not allowed in statics
43  --> $DIR/check-static-values-constraints.rs:96:5
44   |
45LL |     vec![MyOwned],
46   |     ^^^^^^^^^^^^^ allocation not allowed in statics
47   |
48   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
49
50error[E0015]: cannot call non-const fn `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics
51  --> $DIR/check-static-values-constraints.rs:96:5
52   |
53LL |     vec![MyOwned],
54   |     ^^^^^^^^^^^^^
55   |
56   = note: calls in statics are limited to constant functions, tuple structs and tuple variants
57   = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
58   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
59
60error[E0010]: allocations are not allowed in statics
61  --> $DIR/check-static-values-constraints.rs:98:5
62   |
63LL |     vec![MyOwned],
64   |     ^^^^^^^^^^^^^ allocation not allowed in statics
65   |
66   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
67
68error[E0015]: cannot call non-const fn `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics
69  --> $DIR/check-static-values-constraints.rs:98:5
70   |
71LL |     vec![MyOwned],
72   |     ^^^^^^^^^^^^^
73   |
74   = note: calls in statics are limited to constant functions, tuple structs and tuple variants
75   = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
76   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
77
78error[E0010]: allocations are not allowed in statics
79  --> $DIR/check-static-values-constraints.rs:103:6
80   |
81LL |     &vec![MyOwned],
82   |      ^^^^^^^^^^^^^ allocation not allowed in statics
83   |
84   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
85
86error[E0015]: cannot call non-const fn `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics
87  --> $DIR/check-static-values-constraints.rs:103:6
88   |
89LL |     &vec![MyOwned],
90   |      ^^^^^^^^^^^^^
91   |
92   = note: calls in statics are limited to constant functions, tuple structs and tuple variants
93   = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
94   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
95
96error[E0010]: allocations are not allowed in statics
97  --> $DIR/check-static-values-constraints.rs:105:6
98   |
99LL |     &vec![MyOwned],
100   |      ^^^^^^^^^^^^^ allocation not allowed in statics
101   |
102   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
103
104error[E0015]: cannot call non-const fn `slice::<impl [MyOwned]>::into_vec::<std::alloc::Global>` in statics
105  --> $DIR/check-static-values-constraints.rs:105:6
106   |
107LL |     &vec![MyOwned],
108   |      ^^^^^^^^^^^^^
109   |
110   = note: calls in statics are limited to constant functions, tuple structs and tuple variants
111   = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
112   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
113
114error[E0010]: allocations are not allowed in statics
115  --> $DIR/check-static-values-constraints.rs:111:31
116   |
117LL | static STATIC19: Vec<isize> = vec![3];
118   |                               ^^^^^^^ allocation not allowed in statics
119   |
120   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
121
122error[E0015]: cannot call non-const fn `slice::<impl [isize]>::into_vec::<std::alloc::Global>` in statics
123  --> $DIR/check-static-values-constraints.rs:111:31
124   |
125LL | static STATIC19: Vec<isize> = vec![3];
126   |                               ^^^^^^^
127   |
128   = note: calls in statics are limited to constant functions, tuple structs and tuple variants
129   = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
130   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
131
132error[E0507]: cannot move out of static item `x`
133  --> $DIR/check-static-values-constraints.rs:119:9
134   |
135LL |         x
136   |         ^ move occurs because `x` has type `Vec<isize>`, which does not implement the `Copy` trait
137   |
138help: consider borrowing here
139   |
140LL |         &x
141   |         +
142
143error[E0010]: allocations are not allowed in statics
144  --> $DIR/check-static-values-constraints.rs:117:32
145   |
146LL |         static x: Vec<isize> = vec![3];
147   |                                ^^^^^^^ allocation not allowed in statics
148   |
149   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
150
151error[E0015]: cannot call non-const fn `slice::<impl [isize]>::into_vec::<std::alloc::Global>` in statics
152  --> $DIR/check-static-values-constraints.rs:117:32
153   |
154LL |         static x: Vec<isize> = vec![3];
155   |                                ^^^^^^^
156   |
157   = note: calls in statics are limited to constant functions, tuple structs and tuple variants
158   = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell
159   = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info)
160
161error: aborting due to 17 previous errors
162
163Some errors have detailed explanations: E0010, E0015, E0493, E0507.
164For more information about an error, try `rustc --explain E0010`.