]> git.lizzy.rs Git - rust.git/blob - tests/ui/missing_const_for_fn/could_be_const.stderr
09350572e9934b2bbda39bb7242d5b5f058cbf1e
[rust.git] / tests / ui / missing_const_for_fn / could_be_const.stderr
1 error: this could be a const_fn
2   --> $DIR/could_be_const.rs:12:5
3    |
4 LL | /     pub fn new() -> Self {
5 LL | |         Self {
6 LL | |             guess: 42,
7 LL | |         }
8 LL | |     }
9    | |_____^
10    |
11    = note: `-D clippy::missing-const-for-fn` implied by `-D warnings`
12
13 error: this could be a const_fn
14   --> $DIR/could_be_const.rs:20:1
15    |
16 LL | fn one() -> i32 { 1 }
17    | ^^^^^^^^^^^^^^^^^^^^^
18
19 error: this could be a const_fn
20   --> $DIR/could_be_const.rs:30:1
21    |
22 LL | / fn string() -> String {
23 LL | |     String::new()
24 LL | | }
25    | |_^
26
27 error: this could be a const_fn
28   --> $DIR/could_be_const.rs:35:1
29    |
30 LL | unsafe fn four() -> i32 { 4 }
31    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
32
33 error: this could be a const_fn
34   --> $DIR/could_be_const.rs:38:1
35    |
36 LL | / fn generic<T>(t: T) -> T {
37 LL | |     t
38 LL | | }
39    | |_^
40
41 error: aborting due to 5 previous errors
42