summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/missing_const_for_fn/could_be_const.stderr
blob: b3a8ad8fa717ef85030e8eb46d379aef01f2f395 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
error: this could be a `const fn`
  --> $DIR/could_be_const.rs:14:5
   |
LL | /     pub fn new() -> Self {
LL | |
LL | |
LL | |         Self { guess: 42 }
LL | |     }
   | |_____^
   |
   = note: `-D clippy::missing-const-for-fn` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::missing_const_for_fn)]`

error: this could be a `const fn`
  --> $DIR/could_be_const.rs:20:5
   |
LL | /     fn const_generic_params<'a, T, const N: usize>(&self, b: &'a [T; N]) -> &'a [T; N] {
LL | |
LL | |         b
LL | |     }
   | |_____^

error: this could be a `const fn`
  --> $DIR/could_be_const.rs:27:1
   |
LL | / fn one() -> i32 {
LL | |
LL | |     1
LL | | }
   | |_^

error: this could be a `const fn`
  --> $DIR/could_be_const.rs:33:1
   |
LL | / fn two() -> i32 {
LL | |
LL | |     let abc = 2;
LL | |     abc
LL | | }
   | |_^

error: this could be a `const fn`
  --> $DIR/could_be_const.rs:40:1
   |
LL | / fn string() -> String {
LL | |
LL | |     String::new()
LL | | }
   | |_^

error: this could be a `const fn`
  --> $DIR/could_be_const.rs:46:1
   |
LL | / unsafe fn four() -> i32 {
LL | |
LL | |     4
LL | | }
   | |_^

error: this could be a `const fn`
  --> $DIR/could_be_const.rs:52:1
   |
LL | / fn generic<T>(t: T) -> T {
LL | |
LL | |     t
LL | | }
   | |_^

error: this could be a `const fn`
  --> $DIR/could_be_const.rs:61:1
   |
LL | / fn generic_arr<T: Copy>(t: [T; 1]) -> T {
LL | |
LL | |     t[0]
LL | | }
   | |_^

error: this could be a `const fn`
  --> $DIR/could_be_const.rs:75:9
   |
LL | /         pub fn b(self, a: &A) -> B {
LL | |
LL | |             B
LL | |         }
   | |_________^

error: this could be a `const fn`
  --> $DIR/could_be_const.rs:85:5
   |
LL | /     fn const_fn_stabilized_before_msrv(byte: u8) {
LL | |
LL | |         byte.is_ascii_digit();
LL | |     }
   | |_____^

error: this could be a `const fn`
  --> $DIR/could_be_const.rs:97:1
   |
LL | / fn msrv_1_46() -> i32 {
LL | |
LL | |     46
LL | | }
   | |_^

error: aborting due to 11 previous errors