11error: this could be a `const fn`
2- --> tests/ui/missing_const_for_fn/could_be_const.rs:14 :5
2+ --> tests/ui/missing_const_for_fn/could_be_const.rs:15 :5
33 |
44LL | / pub fn new() -> Self {
55LL | |
@@ -16,7 +16,7 @@ LL | pub const fn new() -> Self {
1616 | +++++
1717
1818error: this could be a `const fn`
19- --> tests/ui/missing_const_for_fn/could_be_const.rs:20 :5
19+ --> tests/ui/missing_const_for_fn/could_be_const.rs:21 :5
2020 |
2121LL | / fn const_generic_params<'a, T, const N: usize>(&self, b: &'a [T; N]) -> &'a [T; N] {
2222LL | |
@@ -30,7 +30,7 @@ LL | const fn const_generic_params<'a, T, const N: usize>(&self, b: &'a [T;
3030 | +++++
3131
3232error: this could be a `const fn`
33- --> tests/ui/missing_const_for_fn/could_be_const.rs:27 :1
33+ --> tests/ui/missing_const_for_fn/could_be_const.rs:28 :1
3434 |
3535LL | / fn one() -> i32 {
3636LL | |
@@ -44,7 +44,7 @@ LL | const fn one() -> i32 {
4444 | +++++
4545
4646error: this could be a `const fn`
47- --> tests/ui/missing_const_for_fn/could_be_const.rs:33 :1
47+ --> tests/ui/missing_const_for_fn/could_be_const.rs:34 :1
4848 |
4949LL | / fn two() -> i32 {
5050LL | |
@@ -59,7 +59,7 @@ LL | const fn two() -> i32 {
5959 | +++++
6060
6161error: this could be a `const fn`
62- --> tests/ui/missing_const_for_fn/could_be_const.rs:40 :1
62+ --> tests/ui/missing_const_for_fn/could_be_const.rs:41 :1
6363 |
6464LL | / fn string() -> String {
6565LL | |
@@ -73,7 +73,7 @@ LL | const fn string() -> String {
7373 | +++++
7474
7575error: this could be a `const fn`
76- --> tests/ui/missing_const_for_fn/could_be_const.rs:46 :1
76+ --> tests/ui/missing_const_for_fn/could_be_const.rs:47 :1
7777 |
7878LL | / unsafe fn four() -> i32 {
7979LL | |
@@ -87,7 +87,7 @@ LL | const unsafe fn four() -> i32 {
8787 | +++++
8888
8989error: this could be a `const fn`
90- --> tests/ui/missing_const_for_fn/could_be_const.rs:52 :1
90+ --> tests/ui/missing_const_for_fn/could_be_const.rs:53 :1
9191 |
9292LL | / fn generic<T>(t: T) -> T {
9393LL | |
@@ -101,7 +101,7 @@ LL | const fn generic<T>(t: T) -> T {
101101 | +++++
102102
103103error: this could be a `const fn`
104- --> tests/ui/missing_const_for_fn/could_be_const.rs:61 :1
104+ --> tests/ui/missing_const_for_fn/could_be_const.rs:62 :1
105105 |
106106LL | / fn generic_arr<T: Copy>(t: [T; 1]) -> T {
107107LL | |
@@ -115,7 +115,7 @@ LL | const fn generic_arr<T: Copy>(t: [T; 1]) -> T {
115115 | +++++
116116
117117error: this could be a `const fn`
118- --> tests/ui/missing_const_for_fn/could_be_const.rs:75 :9
118+ --> tests/ui/missing_const_for_fn/could_be_const.rs:76 :9
119119 |
120120LL | / pub fn b(self, a: &A) -> B {
121121LL | |
@@ -129,7 +129,7 @@ LL | pub const fn b(self, a: &A) -> B {
129129 | +++++
130130
131131error: this could be a `const fn`
132- --> tests/ui/missing_const_for_fn/could_be_const.rs:85 :5
132+ --> tests/ui/missing_const_for_fn/could_be_const.rs:86 :5
133133 |
134134LL | / fn const_fn_stabilized_before_msrv(byte: u8) {
135135LL | |
@@ -143,7 +143,7 @@ LL | const fn const_fn_stabilized_before_msrv(byte: u8) {
143143 | +++++
144144
145145error: this could be a `const fn`
146- --> tests/ui/missing_const_for_fn/could_be_const.rs:97 :1
146+ --> tests/ui/missing_const_for_fn/could_be_const.rs:98 :1
147147 |
148148LL | / fn msrv_1_46() -> i32 {
149149LL | |
@@ -157,7 +157,7 @@ LL | const fn msrv_1_46() -> i32 {
157157 | +++++
158158
159159error: this could be a `const fn`
160- --> tests/ui/missing_const_for_fn/could_be_const.rs:117 :1
160+ --> tests/ui/missing_const_for_fn/could_be_const.rs:118 :1
161161 |
162162LL | fn d(this: D) {}
163163 | ^^^^^^^^^^^^^^^^
@@ -168,7 +168,7 @@ LL | const fn d(this: D) {}
168168 | +++++
169169
170170error: this could be a `const fn`
171- --> tests/ui/missing_const_for_fn/could_be_const.rs:125 :9
171+ --> tests/ui/missing_const_for_fn/could_be_const.rs:126 :9
172172 |
173173LL | / fn deref_ptr_can_be_const(self) -> usize {
174174LL | |
@@ -182,7 +182,7 @@ LL | const fn deref_ptr_can_be_const(self) -> usize {
182182 | +++++
183183
184184error: this could be a `const fn`
185- --> tests/ui/missing_const_for_fn/could_be_const.rs:130 :9
185+ --> tests/ui/missing_const_for_fn/could_be_const.rs:131 :9
186186 |
187187LL | / fn deref_copied_val(self) -> usize {
188188LL | |
@@ -196,7 +196,7 @@ LL | const fn deref_copied_val(self) -> usize {
196196 | +++++
197197
198198error: this could be a `const fn`
199- --> tests/ui/missing_const_for_fn/could_be_const.rs:141 :5
199+ --> tests/ui/missing_const_for_fn/could_be_const.rs:142 :5
200200 |
201201LL | / fn union_access_can_be_const() {
202202LL | |
@@ -211,7 +211,7 @@ LL | const fn union_access_can_be_const() {
211211 | +++++
212212
213213error: this could be a `const fn`
214- --> tests/ui/missing_const_for_fn/could_be_const.rs:149 :9
214+ --> tests/ui/missing_const_for_fn/could_be_const.rs:150 :9
215215 |
216216LL | extern "C" fn c() {}
217217 | ^^^^^^^^^^^^^^^^^^^^
@@ -222,7 +222,7 @@ LL | const extern "C" fn c() {}
222222 | +++++
223223
224224error: this could be a `const fn`
225- --> tests/ui/missing_const_for_fn/could_be_const.rs:153 :9
225+ --> tests/ui/missing_const_for_fn/could_be_const.rs:154 :9
226226 |
227227LL | extern fn implicit_c() {}
228228 | ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -233,7 +233,7 @@ LL | const extern fn implicit_c() {}
233233 | +++++
234234
235235error: this could be a `const fn`
236- --> tests/ui/missing_const_for_fn/could_be_const.rs:170 :9
236+ --> tests/ui/missing_const_for_fn/could_be_const.rs:171 :9
237237 |
238238LL | / pub fn new(strings: Vec<String>) -> Self {
239239LL | | Self { strings }
@@ -246,7 +246,7 @@ LL | pub const fn new(strings: Vec<String>) -> Self {
246246 | +++++
247247
248248error: this could be a `const fn`
249- --> tests/ui/missing_const_for_fn/could_be_const.rs:175 :9
249+ --> tests/ui/missing_const_for_fn/could_be_const.rs:176 :9
250250 |
251251LL | / pub fn empty() -> Self {
252252LL | | Self { strings: Vec::new() }
@@ -259,7 +259,7 @@ LL | pub const fn empty() -> Self {
259259 | +++++
260260
261261error: this could be a `const fn`
262- --> tests/ui/missing_const_for_fn/could_be_const.rs:186 :9
262+ --> tests/ui/missing_const_for_fn/could_be_const.rs:187 :9
263263 |
264264LL | / pub fn new(text: String) -> Self {
265265LL | | let vec = Vec::new();
@@ -273,7 +273,7 @@ LL | pub const fn new(text: String) -> Self {
273273 | +++++
274274
275275error: this could be a `const fn`
276- --> tests/ui/missing_const_for_fn/could_be_const.rs:205 :5
276+ --> tests/ui/missing_const_for_fn/could_be_const.rs:206 :5
277277 |
278278LL | fn alias_ty_is_projection(bar: <() as FooTrait>::Foo) {}
279279 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -283,5 +283,60 @@ help: make the function `const`
283283LL | const fn alias_ty_is_projection(bar: <() as FooTrait>::Foo) {}
284284 | +++++
285285
286- error: aborting due to 21 previous errors
286+ error: this could be a `const fn`
287+ --> tests/ui/missing_const_for_fn/could_be_const.rs:210:5
288+ |
289+ LL | extern "C-unwind" fn c_unwind() {}
290+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
291+ |
292+ help: make the function `const`
293+ |
294+ LL | const extern "C-unwind" fn c_unwind() {}
295+ | +++++
296+
297+ error: this could be a `const fn`
298+ --> tests/ui/missing_const_for_fn/could_be_const.rs:212:5
299+ |
300+ LL | extern "system" fn system() {}
301+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
302+ |
303+ help: make the function `const`
304+ |
305+ LL | const extern "system" fn system() {}
306+ | +++++
307+
308+ error: this could be a `const fn`
309+ --> tests/ui/missing_const_for_fn/could_be_const.rs:214:5
310+ |
311+ LL | extern "system-unwind" fn system_unwind() {}
312+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
313+ |
314+ help: make the function `const`
315+ |
316+ LL | const extern "system-unwind" fn system_unwind() {}
317+ | +++++
318+
319+ error: this could be a `const fn`
320+ --> tests/ui/missing_const_for_fn/could_be_const.rs:216:5
321+ |
322+ LL | pub extern "stdcall" fn std_call() {}
323+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
324+ |
325+ help: make the function `const`
326+ |
327+ LL | pub const extern "stdcall" fn std_call() {}
328+ | +++++
329+
330+ error: this could be a `const fn`
331+ --> tests/ui/missing_const_for_fn/could_be_const.rs:218:5
332+ |
333+ LL | pub extern "stdcall-unwind" fn std_call_unwind() {}
334+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
335+ |
336+ help: make the function `const`
337+ |
338+ LL | pub const extern "stdcall-unwind" fn std_call_unwind() {}
339+ | +++++
340+
341+ error: aborting due to 26 previous errors
287342
0 commit comments