]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/missing_const_for_fn/could_be_const.stderr
New upstream version 1.61.0+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / missing_const_for_fn / could_be_const.stderr
CommitLineData
f20569fa 1error: this could be a `const fn`
94222f64 2 --> $DIR/could_be_const.rs:13:5
f20569fa
XL
3 |
4LL | / pub fn new() -> Self {
5LL | | Self { guess: 42 }
6LL | | }
7 | |_____^
8 |
9 = note: `-D clippy::missing-const-for-fn` implied by `-D warnings`
10
11error: this could be a `const fn`
94222f64 12 --> $DIR/could_be_const.rs:17:5
f20569fa
XL
13 |
14LL | / fn const_generic_params<'a, T, const N: usize>(&self, b: &'a [T; N]) -> &'a [T; N] {
15LL | | b
16LL | | }
17 | |_____^
18
19error: this could be a `const fn`
94222f64 20 --> $DIR/could_be_const.rs:23:1
f20569fa
XL
21 |
22LL | / fn one() -> i32 {
23LL | | 1
24LL | | }
25 | |_^
26
27error: this could be a `const fn`
94222f64 28 --> $DIR/could_be_const.rs:28:1
f20569fa
XL
29 |
30LL | / fn two() -> i32 {
31LL | | let abc = 2;
32LL | | abc
33LL | | }
34 | |_^
35
36error: this could be a `const fn`
94222f64 37 --> $DIR/could_be_const.rs:34:1
f20569fa
XL
38 |
39LL | / fn string() -> String {
40LL | | String::new()
41LL | | }
42 | |_^
43
44error: this could be a `const fn`
94222f64 45 --> $DIR/could_be_const.rs:39:1
f20569fa
XL
46 |
47LL | / unsafe fn four() -> i32 {
48LL | | 4
49LL | | }
50 | |_^
51
52error: this could be a `const fn`
94222f64 53 --> $DIR/could_be_const.rs:44:1
f20569fa
XL
54 |
55LL | / fn generic<T>(t: T) -> T {
56LL | | t
57LL | | }
58 | |_^
59
60error: this could be a `const fn`
ee023bcb
FG
61 --> $DIR/could_be_const.rs:52:1
62 |
63LL | / fn generic_arr<T: Copy>(t: [T; 1]) -> T {
64LL | | t[0]
65LL | | }
66 | |_^
67
68error: this could be a `const fn`
69 --> $DIR/could_be_const.rs:65:9
f20569fa
XL
70 |
71LL | / pub fn b(self, a: &A) -> B {
72LL | | B
73LL | | }
74 | |_________^
75
cdc7bbd5 76error: this could be a `const fn`
ee023bcb 77 --> $DIR/could_be_const.rs:75:5
cdc7bbd5
XL
78 |
79LL | / fn const_fn_stabilized_before_msrv(byte: u8) {
80LL | | byte.is_ascii_digit();
81LL | | }
82 | |_____^
83
ee023bcb 84error: aborting due to 10 previous errors
f20569fa 85