]>
Commit | Line | Data |
---|---|---|
b7449926 XL |
1 | error[E0493]: destructors cannot be evaluated at compile-time |
2 | --> $DIR/min_const_fn.rs:49:25 | |
3 | | | |
4 | LL | const fn into_inner(self) -> T { self.0 } //~ destructors cannot be evaluated | |
5 | | ^^^^ constant functions cannot evaluate destructors | |
6 | ||
7 | error: mutable references in const fn are unstable | |
8 | --> $DIR/min_const_fn.rs:51:5 | |
9 | | | |
10 | LL | const fn get_mut(&mut self) -> &mut T { &mut self.0 } | |
11 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
12 | ||
13 | error[E0493]: destructors cannot be evaluated at compile-time | |
14 | --> $DIR/min_const_fn.rs:56:28 | |
15 | | | |
16 | LL | const fn into_inner_lt(self) -> T { self.0 } //~ destructors cannot be evaluated | |
17 | | ^^^^ constant functions cannot evaluate destructors | |
18 | ||
19 | error: mutable references in const fn are unstable | |
20 | --> $DIR/min_const_fn.rs:58:5 | |
21 | | | |
22 | LL | const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 } | |
23 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
24 | ||
25 | error[E0493]: destructors cannot be evaluated at compile-time | |
26 | --> $DIR/min_const_fn.rs:63:27 | |
27 | | | |
28 | LL | const fn into_inner_s(self) -> T { self.0 } //~ ERROR destructors | |
29 | | ^^^^ constant functions cannot evaluate destructors | |
30 | ||
31 | error: mutable references in const fn are unstable | |
32 | --> $DIR/min_const_fn.rs:65:5 | |
33 | | | |
34 | LL | const fn get_mut_s(&mut self) -> &mut T { &mut self.0 } | |
35 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
36 | ||
37 | error: mutable references in const fn are unstable | |
38 | --> $DIR/min_const_fn.rs:70:5 | |
39 | | | |
40 | LL | const fn get_mut_sq(&mut self) -> &mut T { &mut self.0 } | |
41 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
42 | ||
43 | error: trait bounds other than `Sized` on const fn parameters are unstable | |
44 | --> $DIR/min_const_fn.rs:88:16 | |
45 | | | |
46 | LL | const fn foo11<T: std::fmt::Display>(t: T) -> T { t } | |
47 | | ^ | |
48 | ||
49 | error: trait bounds other than `Sized` on const fn parameters are unstable | |
50 | --> $DIR/min_const_fn.rs:90:18 | |
51 | | | |
52 | LL | const fn foo11_2<T: Send>(t: T) -> T { t } | |
53 | | ^ | |
54 | ||
55 | error: only int, `bool` and `char` operations are stable in const fn | |
56 | --> $DIR/min_const_fn.rs:92:33 | |
57 | | | |
58 | LL | const fn foo19(f: f32) -> f32 { f * 2.0 } | |
59 | | ^^^^^^^ | |
60 | ||
61 | error: only int, `bool` and `char` operations are stable in const fn | |
62 | --> $DIR/min_const_fn.rs:94:35 | |
63 | | | |
64 | LL | const fn foo19_2(f: f32) -> f32 { 2.0 - f } | |
65 | | ^^^^^^^ | |
66 | ||
67 | error: only int and `bool` operations are stable in const fn | |
68 | --> $DIR/min_const_fn.rs:96:35 | |
69 | | | |
70 | LL | const fn foo19_3(f: f32) -> f32 { -f } | |
71 | | ^^ | |
72 | ||
73 | error: only int, `bool` and `char` operations are stable in const fn | |
74 | --> $DIR/min_const_fn.rs:98:43 | |
75 | | | |
76 | LL | const fn foo19_4(f: f32, g: f32) -> f32 { f / g } | |
77 | | ^^^^^ | |
78 | ||
79 | error: cannot access `static` items in const fn | |
80 | --> $DIR/min_const_fn.rs:102:27 | |
81 | | | |
82 | LL | const fn foo25() -> u32 { BAR } //~ ERROR cannot access `static` items in const fn | |
83 | | ^^^ | |
84 | ||
85 | error: cannot access `static` items in const fn | |
86 | --> $DIR/min_const_fn.rs:103:36 | |
87 | | | |
88 | LL | const fn foo26() -> &'static u32 { &BAR } //~ ERROR cannot access `static` items | |
89 | | ^^^^ | |
90 | ||
91 | error: casting pointers to ints is unstable in const fn | |
92 | --> $DIR/min_const_fn.rs:104:42 | |
93 | | | |
94 | LL | const fn foo30(x: *const u32) -> usize { x as usize } | |
95 | | ^^^^^^^^^^ | |
96 | ||
97 | error: casting pointers to ints is unstable in const fn | |
98 | --> $DIR/min_const_fn.rs:106:42 | |
99 | | | |
100 | LL | const fn foo30_2(x: *mut u32) -> usize { x as usize } | |
101 | | ^^^^^^^^^^ | |
102 | ||
103 | error: `if`, `match`, `&&` and `||` are not stable in const fn | |
104 | --> $DIR/min_const_fn.rs:108:38 | |
105 | | | |
106 | LL | const fn foo30_4(b: bool) -> usize { if b { 1 } else { 42 } } | |
107 | | ^^^^^^^^^^^^^^^^^^^^^^ | |
108 | ||
109 | error: `if`, `match`, `&&` and `||` are not stable in const fn | |
110 | --> $DIR/min_const_fn.rs:110:29 | |
111 | | | |
112 | LL | const fn foo30_5(b: bool) { while b { } } //~ ERROR not stable in const fn | |
113 | | ^^^^^^^^^^^ | |
114 | ||
115 | error: local variables in const fn are unstable | |
116 | --> $DIR/min_const_fn.rs:111:34 | |
117 | | | |
118 | LL | const fn foo30_6() -> bool { let x = true; x } //~ ERROR local variables in const fn are unstable | |
119 | | ^ | |
120 | ||
121 | error: `if`, `match`, `&&` and `||` are not stable in const fn | |
122 | --> $DIR/min_const_fn.rs:112:44 | |
123 | | | |
124 | LL | const fn foo36(a: bool, b: bool) -> bool { a && b } | |
125 | | ^^^^^^ | |
126 | ||
127 | error: `if`, `match`, `&&` and `||` are not stable in const fn | |
128 | --> $DIR/min_const_fn.rs:114:44 | |
129 | | | |
130 | LL | const fn foo37(a: bool, b: bool) -> bool { a || b } | |
131 | | ^^^^^^ | |
132 | ||
133 | error: mutable references in const fn are unstable | |
134 | --> $DIR/min_const_fn.rs:116:14 | |
135 | | | |
136 | LL | const fn inc(x: &mut i32) { *x += 1 } | |
137 | | ^ | |
138 | ||
139 | error: trait bounds other than `Sized` on const fn parameters are unstable | |
140 | --> $DIR/min_const_fn.rs:121:6 | |
141 | | | |
142 | LL | impl<T: std::fmt::Debug> Foo<T> { | |
143 | | ^ | |
144 | ||
145 | error: trait bounds other than `Sized` on const fn parameters are unstable | |
146 | --> $DIR/min_const_fn.rs:126:6 | |
147 | | | |
148 | LL | impl<T: std::fmt::Debug + Sized> Foo<T> { | |
149 | | ^ | |
150 | ||
151 | error: trait bounds other than `Sized` on const fn parameters are unstable | |
152 | --> $DIR/min_const_fn.rs:131:6 | |
153 | | | |
154 | LL | impl<T: Sync + Sized> Foo<T> { | |
155 | | ^ | |
156 | ||
157 | error: `impl Trait` in const fn is unstable | |
158 | --> $DIR/min_const_fn.rs:137:1 | |
159 | | | |
160 | LL | const fn no_rpit2() -> AlanTuring<impl std::fmt::Debug> { AlanTuring(0) } | |
161 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
162 | ||
163 | error: trait bounds other than `Sized` on const fn parameters are unstable | |
164 | --> $DIR/min_const_fn.rs:139:34 | |
165 | | | |
166 | LL | const fn no_apit2(_x: AlanTuring<impl std::fmt::Debug>) {} | |
167 | | ^^^^^^^^^^^^^^^^^^^^ | |
168 | ||
169 | error: trait bounds other than `Sized` on const fn parameters are unstable | |
170 | --> $DIR/min_const_fn.rs:141:22 | |
171 | | | |
172 | LL | const fn no_apit(_x: impl std::fmt::Debug) {} //~ ERROR trait bounds other than `Sized` | |
173 | | ^^^^^^^^^^^^^^^^^^^^ | |
174 | ||
175 | error: `impl Trait` in const fn is unstable | |
176 | --> $DIR/min_const_fn.rs:142:1 | |
177 | | | |
178 | LL | const fn no_rpit() -> impl std::fmt::Debug {} //~ ERROR `impl Trait` in const fn is unstable | |
179 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
180 | ||
181 | error: trait bounds other than `Sized` on const fn parameters are unstable | |
182 | --> $DIR/min_const_fn.rs:143:23 | |
183 | | | |
184 | LL | const fn no_dyn_trait(_x: &dyn std::fmt::Debug) {} //~ ERROR trait bounds other than `Sized` | |
185 | | ^^ | |
186 | ||
187 | error: trait bounds other than `Sized` on const fn parameters are unstable | |
188 | --> $DIR/min_const_fn.rs:144:1 | |
189 | | | |
190 | LL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() } | |
191 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
192 | ||
193 | error[E0597]: borrowed value does not live long enough | |
194 | --> $DIR/min_const_fn.rs:144:64 | |
195 | | | |
196 | LL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() } | |
197 | | ^^ - temporary value only lives until here | |
198 | | | | |
199 | | temporary value does not live long enough | |
200 | | | |
201 | = note: borrowed value must be valid for the static lifetime... | |
202 | ||
203 | error: trait bounds other than `Sized` on const fn parameters are unstable | |
204 | --> $DIR/min_const_fn.rs:149:41 | |
205 | | | |
206 | LL | const fn really_no_traits_i_mean_it() { (&() as &std::fmt::Debug, ()).1 } | |
207 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
208 | ||
209 | error: function pointers in const fn are unstable | |
210 | --> $DIR/min_const_fn.rs:152:21 | |
211 | | | |
212 | LL | const fn no_fn_ptrs(_x: fn()) {} | |
213 | | ^^ | |
214 | ||
215 | error: function pointers in const fn are unstable | |
216 | --> $DIR/min_const_fn.rs:154:1 | |
217 | | | |
218 | LL | const fn no_fn_ptrs2() -> fn() { fn foo() {} foo } | |
219 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
220 | ||
221 | error: aborting due to 36 previous errors | |
222 | ||
223 | Some errors occurred: E0493, E0597. | |
224 | For more information about an error, try `rustc --explain E0493`. |