]> git.lizzy.rs Git - rust.git/blob - tests/ui/wrong_self_convention2.rs
Improved shared_code_in_if_blocks message and added test stderrs
[rust.git] / tests / ui / wrong_self_convention2.rs
1 // edition:2018
2 #![warn(clippy::wrong_self_convention)]
3 #![warn(clippy::wrong_pub_self_convention)]
4 #![allow(dead_code)]
5
6 fn main() {}
7
8 mod issue6983 {
9     pub struct Thing;
10     pub trait Trait {
11         fn to_thing(&self) -> Thing;
12     }
13
14     impl Trait for u8 {
15         // don't trigger, e.g. `ToString` from `std` requires `&self`
16         fn to_thing(&self) -> Thing {
17             Thing
18         }
19     }
20
21     trait ToU64 {
22         fn to_u64(self) -> u64;
23     }
24
25     struct FooNoCopy;
26     // trigger lint
27     impl ToU64 for FooNoCopy {
28         fn to_u64(self) -> u64 {
29             2
30         }
31     }
32 }