blob: b2cade3056373ba9cb04e9a8b541ebdabd06a83d [file] [log] [blame]
error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/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`
--> tests/ui/missing_const_for_fn/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`
--> tests/ui/missing_const_for_fn/could_be_const.rs:27:1
|
LL | / fn one() -> i32 {
LL | |
LL | | 1
LL | | }
| |_^
error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/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`
--> tests/ui/missing_const_for_fn/could_be_const.rs:40:1
|
LL | / fn string() -> String {
LL | |
LL | | String::new()
LL | | }
| |_^
error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:46:1
|
LL | / unsafe fn four() -> i32 {
LL | |
LL | | 4
LL | | }
| |_^
error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:52:1
|
LL | / fn generic<T>(t: T) -> T {
LL | |
LL | | t
LL | | }
| |_^
error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/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`
--> tests/ui/missing_const_for_fn/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`
--> tests/ui/missing_const_for_fn/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`
--> tests/ui/missing_const_for_fn/could_be_const.rs:97:1
|
LL | / fn msrv_1_46() -> i32 {
LL | |
LL | | 46
LL | | }
| |_^
error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:122:9
|
LL | / fn deref_ptr_can_be_const(self) -> usize {
LL | |
LL | | unsafe { *self.0 as usize }
LL | | }
| |_________^
error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:127:9
|
LL | / fn deref_copied_val(self) -> usize {
LL | |
LL | | *self.1 as usize
LL | | }
| |_________^
error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:138:5
|
LL | / fn union_access_can_be_const() {
LL | |
LL | | let bar = Bar { val: 1 };
LL | | let _ = unsafe { bar.val };
LL | | }
| |_____^
error: aborting due to 14 previous errors