]>
Commit | Line | Data |
---|---|---|
f20569fa XL |
1 | error: this could be a `const fn` |
2 | --> $DIR/could_be_const.rs:13:5 | |
3 | | | |
4 | LL | / pub fn new() -> Self { | |
5 | LL | | Self { guess: 42 } | |
6 | LL | | } | |
7 | | |_____^ | |
8 | | | |
9 | = note: `-D clippy::missing-const-for-fn` implied by `-D warnings` | |
10 | ||
11 | error: this could be a `const fn` | |
12 | --> $DIR/could_be_const.rs:17:5 | |
13 | | | |
14 | LL | / fn const_generic_params<'a, T, const N: usize>(&self, b: &'a [T; N]) -> &'a [T; N] { | |
15 | LL | | b | |
16 | LL | | } | |
17 | | |_____^ | |
18 | ||
19 | error: this could be a `const fn` | |
20 | --> $DIR/could_be_const.rs:23:1 | |
21 | | | |
22 | LL | / fn one() -> i32 { | |
23 | LL | | 1 | |
24 | LL | | } | |
25 | | |_^ | |
26 | ||
27 | error: this could be a `const fn` | |
28 | --> $DIR/could_be_const.rs:28:1 | |
29 | | | |
30 | LL | / fn two() -> i32 { | |
31 | LL | | let abc = 2; | |
32 | LL | | abc | |
33 | LL | | } | |
34 | | |_^ | |
35 | ||
36 | error: this could be a `const fn` | |
37 | --> $DIR/could_be_const.rs:34:1 | |
38 | | | |
39 | LL | / fn string() -> String { | |
40 | LL | | String::new() | |
41 | LL | | } | |
42 | | |_^ | |
43 | ||
44 | error: this could be a `const fn` | |
45 | --> $DIR/could_be_const.rs:39:1 | |
46 | | | |
47 | LL | / unsafe fn four() -> i32 { | |
48 | LL | | 4 | |
49 | LL | | } | |
50 | | |_^ | |
51 | ||
52 | error: this could be a `const fn` | |
53 | --> $DIR/could_be_const.rs:44:1 | |
54 | | | |
55 | LL | / fn generic<T>(t: T) -> T { | |
56 | LL | | t | |
57 | LL | | } | |
58 | | |_^ | |
59 | ||
60 | error: this could be a `const fn` | |
61 | --> $DIR/could_be_const.rs:67:9 | |
62 | | | |
63 | LL | / pub fn b(self, a: &A) -> B { | |
64 | LL | | B | |
65 | LL | | } | |
66 | | |_________^ | |
67 | ||
68 | error: aborting due to 8 previous errors | |
69 |