@@ -4,197 +4,257 @@ error[E0493]: destructors cannot be evaluated at compile-time
44LL | const fn into_inner(self) -> T { self.0 } //~ destructors cannot be evaluated
55 | ^^^^ constant functions cannot evaluate destructors
66
7- error: mutable references in const fn are unstable
7+ error[E0723] : mutable references in const fn are unstable (see issue #57563)
88 --> $DIR/min_const_fn.rs:39:36
99 |
1010LL | const fn get_mut(&mut self) -> &mut T { &mut self.0 }
1111 | ^^^^^^
12+ |
13+ = help: add #![feature(const_fn)] to the crate attributes to enable
1214
1315error[E0493]: destructors cannot be evaluated at compile-time
1416 --> $DIR/min_const_fn.rs:44:28
1517 |
1618LL | const fn into_inner_lt(self) -> T { self.0 } //~ destructors cannot be evaluated
1719 | ^^^^ constant functions cannot evaluate destructors
1820
19- error: mutable references in const fn are unstable
21+ error[E0723] : mutable references in const fn are unstable (see issue #57563)
2022 --> $DIR/min_const_fn.rs:46:42
2123 |
2224LL | const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 }
2325 | ^^^^^^
26+ |
27+ = help: add #![feature(const_fn)] to the crate attributes to enable
2428
2529error[E0493]: destructors cannot be evaluated at compile-time
2630 --> $DIR/min_const_fn.rs:51:27
2731 |
2832LL | const fn into_inner_s(self) -> T { self.0 } //~ ERROR destructors
2933 | ^^^^ constant functions cannot evaluate destructors
3034
31- error: mutable references in const fn are unstable
35+ error[E0723] : mutable references in const fn are unstable (see issue #57563)
3236 --> $DIR/min_const_fn.rs:53:38
3337 |
3438LL | const fn get_mut_s(&mut self) -> &mut T { &mut self.0 }
3539 | ^^^^^^
40+ |
41+ = help: add #![feature(const_fn)] to the crate attributes to enable
3642
37- error: mutable references in const fn are unstable
43+ error[E0723] : mutable references in const fn are unstable (see issue #57563)
3844 --> $DIR/min_const_fn.rs:58:39
3945 |
4046LL | const fn get_mut_sq(&mut self) -> &mut T { &mut self.0 }
4147 | ^^^^^^
48+ |
49+ = help: add #![feature(const_fn)] to the crate attributes to enable
4250
43- error: trait bounds other than `Sized` on const fn parameters are unstable
51+ error[E0723] : trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
4452 --> $DIR/min_const_fn.rs:76:16
4553 |
4654LL | const fn foo11<T: std::fmt::Display>(t: T) -> T { t }
4755 | ^
56+ |
57+ = help: add #![feature(const_fn)] to the crate attributes to enable
4858
49- error: trait bounds other than `Sized` on const fn parameters are unstable
59+ error[E0723] : trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
5060 --> $DIR/min_const_fn.rs:78:18
5161 |
5262LL | const fn foo11_2<T: Send>(t: T) -> T { t }
5363 | ^
64+ |
65+ = help: add #![feature(const_fn)] to the crate attributes to enable
5466
55- error: only int, `bool` and `char` operations are stable in const fn
67+ error[E0723] : only int, `bool` and `char` operations are stable in const fn (see issue #57563)
5668 --> $DIR/min_const_fn.rs:80:33
5769 |
5870LL | const fn foo19(f: f32) -> f32 { f * 2.0 }
5971 | ^^^^^^^
72+ |
73+ = help: add #![feature(const_fn)] to the crate attributes to enable
6074
61- error: only int, `bool` and `char` operations are stable in const fn
75+ error[E0723] : only int, `bool` and `char` operations are stable in const fn (see issue #57563)
6276 --> $DIR/min_const_fn.rs:82:35
6377 |
6478LL | const fn foo19_2(f: f32) -> f32 { 2.0 - f }
6579 | ^^^^^^^
80+ |
81+ = help: add #![feature(const_fn)] to the crate attributes to enable
6682
67- error: only int and `bool` operations are stable in const fn
83+ error[E0723] : only int and `bool` operations are stable in const fn (see issue #57563)
6884 --> $DIR/min_const_fn.rs:84:35
6985 |
7086LL | const fn foo19_3(f: f32) -> f32 { -f }
7187 | ^^
88+ |
89+ = help: add #![feature(const_fn)] to the crate attributes to enable
7290
73- error: only int, `bool` and `char` operations are stable in const fn
91+ error[E0723] : only int, `bool` and `char` operations are stable in const fn (see issue #57563)
7492 --> $DIR/min_const_fn.rs:86:43
7593 |
7694LL | const fn foo19_4(f: f32, g: f32) -> f32 { f / g }
7795 | ^^^^^
96+ |
97+ = help: add #![feature(const_fn)] to the crate attributes to enable
7898
79- error: cannot access `static` items in const fn
99+ error[E0723] : cannot access `static` items in const fn (see issue #57563)
80100 --> $DIR/min_const_fn.rs:90:27
81101 |
82102LL | const fn foo25() -> u32 { BAR } //~ ERROR cannot access `static` items in const fn
83103 | ^^^
104+ |
105+ = help: add #![feature(const_fn)] to the crate attributes to enable
84106
85- error: cannot access `static` items in const fn
107+ error[E0723] : cannot access `static` items in const fn (see issue #57563)
86108 --> $DIR/min_const_fn.rs:91:36
87109 |
88110LL | const fn foo26() -> &'static u32 { &BAR } //~ ERROR cannot access `static` items
89111 | ^^^^
112+ |
113+ = help: add #![feature(const_fn)] to the crate attributes to enable
90114
91- error: casting pointers to ints is unstable in const fn
115+ error[E0723] : casting pointers to ints is unstable in const fn (see issue #57563)
92116 --> $DIR/min_const_fn.rs:92:42
93117 |
94118LL | const fn foo30(x: *const u32) -> usize { x as usize }
95119 | ^^^^^^^^^^
120+ |
121+ = help: add #![feature(const_fn)] to the crate attributes to enable
96122
97- error: casting pointers to ints is unstable in const fn
123+ error[E0723] : casting pointers to ints is unstable in const fn (see issue #57563)
98124 --> $DIR/min_const_fn.rs:94:63
99125 |
100126LL | const fn foo30_with_unsafe(x: *const u32) -> usize { unsafe { x as usize } }
101127 | ^^^^^^^^^^
128+ |
129+ = help: add #![feature(const_fn)] to the crate attributes to enable
102130
103- error: casting pointers to ints is unstable in const fn
131+ error[E0723] : casting pointers to ints is unstable in const fn (see issue #57563)
104132 --> $DIR/min_const_fn.rs:96:42
105133 |
106134LL | const fn foo30_2(x: *mut u32) -> usize { x as usize }
107135 | ^^^^^^^^^^
136+ |
137+ = help: add #![feature(const_fn)] to the crate attributes to enable
108138
109- error: casting pointers to ints is unstable in const fn
139+ error[E0723] : casting pointers to ints is unstable in const fn (see issue #57563)
110140 --> $DIR/min_const_fn.rs:98:63
111141 |
112142LL | const fn foo30_2_with_unsafe(x: *mut u32) -> usize { unsafe { x as usize } }
113143 | ^^^^^^^^^^
144+ |
145+ = help: add #![feature(const_fn)] to the crate attributes to enable
114146
115- error: `if`, `match`, `&&` and `||` are not stable in const fn
147+ error[E0723] : `if`, `match`, `&&` and `||` are not stable in const fn (see issue #57563)
116148 --> $DIR/min_const_fn.rs:100:38
117149 |
118150LL | const fn foo30_4(b: bool) -> usize { if b { 1 } else { 42 } }
119151 | ^^^^^^^^^^^^^^^^^^^^^^
152+ |
153+ = help: add #![feature(const_fn)] to the crate attributes to enable
120154
121- error: `if`, `match`, `&&` and `||` are not stable in const fn
155+ error[E0723] : `if`, `match`, `&&` and `||` are not stable in const fn (see issue #57563)
122156 --> $DIR/min_const_fn.rs:102:29
123157 |
124158LL | const fn foo30_5(b: bool) { while b { } } //~ ERROR not stable in const fn
125159 | ^^^^^^^^^^^
160+ |
161+ = help: add #![feature(const_fn)] to the crate attributes to enable
126162
127- error: `if`, `match`, `&&` and `||` are not stable in const fn
163+ error[E0723] : `if`, `match`, `&&` and `||` are not stable in const fn (see issue #57563)
128164 --> $DIR/min_const_fn.rs:104:44
129165 |
130166LL | const fn foo36(a: bool, b: bool) -> bool { a && b }
131167 | ^^^^^^
168+ |
169+ = help: add #![feature(const_fn)] to the crate attributes to enable
132170
133- error: `if`, `match`, `&&` and `||` are not stable in const fn
171+ error[E0723] : `if`, `match`, `&&` and `||` are not stable in const fn (see issue #57563)
134172 --> $DIR/min_const_fn.rs:106:44
135173 |
136174LL | const fn foo37(a: bool, b: bool) -> bool { a || b }
137175 | ^^^^^^
176+ |
177+ = help: add #![feature(const_fn)] to the crate attributes to enable
138178
139- error: mutable references in const fn are unstable
179+ error[E0723] : mutable references in const fn are unstable (see issue #57563)
140180 --> $DIR/min_const_fn.rs:108:14
141181 |
142182LL | const fn inc(x: &mut i32) { *x += 1 }
143183 | ^
184+ |
185+ = help: add #![feature(const_fn)] to the crate attributes to enable
144186
145- error: trait bounds other than `Sized` on const fn parameters are unstable
187+ error[E0723] : trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
146188 --> $DIR/min_const_fn.rs:113:6
147189 |
148190LL | impl<T: std::fmt::Debug> Foo<T> {
149191 | ^
192+ |
193+ = help: add #![feature(const_fn)] to the crate attributes to enable
150194
151- error: trait bounds other than `Sized` on const fn parameters are unstable
195+ error[E0723] : trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
152196 --> $DIR/min_const_fn.rs:118:6
153197 |
154198LL | impl<T: std::fmt::Debug + Sized> Foo<T> {
155199 | ^
200+ |
201+ = help: add #![feature(const_fn)] to the crate attributes to enable
156202
157- error: trait bounds other than `Sized` on const fn parameters are unstable
203+ error[E0723] : trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
158204 --> $DIR/min_const_fn.rs:123:6
159205 |
160206LL | impl<T: Sync + Sized> Foo<T> {
161207 | ^
208+ |
209+ = help: add #![feature(const_fn)] to the crate attributes to enable
162210
163- error: `impl Trait` in const fn is unstable
211+ error[E0723] : `impl Trait` in const fn is unstable (see issue #57563)
164212 --> $DIR/min_const_fn.rs:129:24
165213 |
166214LL | const fn no_rpit2() -> AlanTuring<impl std::fmt::Debug> { AlanTuring(0) }
167215 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
216+ |
217+ = help: add #![feature(const_fn)] to the crate attributes to enable
168218
169- error: trait bounds other than `Sized` on const fn parameters are unstable
219+ error[E0723] : trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
170220 --> $DIR/min_const_fn.rs:131:34
171221 |
172222LL | const fn no_apit2(_x: AlanTuring<impl std::fmt::Debug>) {}
173223 | ^^^^^^^^^^^^^^^^^^^^
224+ |
225+ = help: add #![feature(const_fn)] to the crate attributes to enable
174226
175- error: trait bounds other than `Sized` on const fn parameters are unstable
227+ error[E0723] : trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
176228 --> $DIR/min_const_fn.rs:133:22
177229 |
178230LL | const fn no_apit(_x: impl std::fmt::Debug) {} //~ ERROR trait bounds other than `Sized`
179231 | ^^^^^^^^^^^^^^^^^^^^
232+ |
233+ = help: add #![feature(const_fn)] to the crate attributes to enable
180234
181- error: `impl Trait` in const fn is unstable
235+ error[E0723] : `impl Trait` in const fn is unstable (see issue #57563)
182236 --> $DIR/min_const_fn.rs:134:23
183237 |
184238LL | const fn no_rpit() -> impl std::fmt::Debug {} //~ ERROR `impl Trait` in const fn is unstable
185239 | ^^^^^^^^^^^^^^^^^^^^
240+ |
241+ = help: add #![feature(const_fn)] to the crate attributes to enable
186242
187- error: trait bounds other than `Sized` on const fn parameters are unstable
243+ error[E0723] : trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
188244 --> $DIR/min_const_fn.rs:135:23
189245 |
190246LL | const fn no_dyn_trait(_x: &dyn std::fmt::Debug) {} //~ ERROR trait bounds other than `Sized`
191247 | ^^
248+ |
249+ = help: add #![feature(const_fn)] to the crate attributes to enable
192250
193- error: trait bounds other than `Sized` on const fn parameters are unstable
251+ error[E0723] : trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
194252 --> $DIR/min_const_fn.rs:136:32
195253 |
196254LL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() }
197255 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
256+ |
257+ = help: add #![feature(const_fn)] to the crate attributes to enable
198258
199259warning[E0515]: cannot return reference to temporary value
200260 --> $DIR/min_const_fn.rs:136:63
@@ -208,25 +268,31 @@ LL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() }
208268 = warning: this error has been downgraded to a warning for backwards compatibility with previous releases
209269 = warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future
210270
211- error: trait bounds other than `Sized` on const fn parameters are unstable
271+ error[E0723] : trait bounds other than `Sized` on const fn parameters are unstable (see issue #57563)
212272 --> $DIR/min_const_fn.rs:141:41
213273 |
214274LL | const fn really_no_traits_i_mean_it() { (&() as &std::fmt::Debug, ()).1 }
215275 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
276+ |
277+ = help: add #![feature(const_fn)] to the crate attributes to enable
216278
217- error: function pointers in const fn are unstable
279+ error[E0723] : function pointers in const fn are unstable (see issue #57563)
218280 --> $DIR/min_const_fn.rs:144:21
219281 |
220282LL | const fn no_fn_ptrs(_x: fn()) {}
221283 | ^^
284+ |
285+ = help: add #![feature(const_fn)] to the crate attributes to enable
222286
223- error: function pointers in const fn are unstable
287+ error[E0723] : function pointers in const fn are unstable (see issue #57563)
224288 --> $DIR/min_const_fn.rs:146:27
225289 |
226290LL | const fn no_fn_ptrs2() -> fn() { fn foo() {} foo }
227291 | ^^^^
292+ |
293+ = help: add #![feature(const_fn)] to the crate attributes to enable
228294
229295error: aborting due to 36 previous errors
230296
231- Some errors occurred: E0493, E0515.
297+ Some errors occurred: E0493, E0515, E0723 .
232298For more information about an error, try `rustc --explain E0493`.
0 commit comments