]> git.lizzy.rs Git - rust.git/blob - tests/ui/wrong_self_convention.rs
Merge pull request #1520 from Manishearth/rustup
[rust.git] / tests / ui / wrong_self_convention.rs
1 #![feature(plugin)]
2 #![plugin(clippy)]
3
4 #![deny(wrong_self_convention)]
5 #![deny(wrong_pub_self_convention)]
6 #![allow(dead_code)]
7
8 fn main() {}
9
10 #[derive(Clone, Copy)]
11 struct Foo;
12
13 impl Foo {
14
15     fn as_i32(self) {}
16     fn as_u32(&self) {}
17     fn into_i32(self) {}
18     fn is_i32(self) {}
19     fn is_u32(&self) {}
20     fn to_i32(self) {}
21     fn from_i32(self) {}
22
23     pub fn as_i64(self) {}
24     pub fn into_i64(self) {}
25     pub fn is_i64(self) {}
26     pub fn to_i64(self) {}
27     pub fn from_i64(self) {}
28     // check whether the lint can be allowed at the function level
29     #[allow(wrong_self_convention)]
30     pub fn from_cake(self) {}
31
32 }
33
34 struct Bar;
35
36 impl Bar {
37
38     fn as_i32(self) {}
39     fn as_u32(&self) {}
40     fn into_i32(&self) {}
41     fn into_u32(self) {}
42     fn is_i32(self) {}
43     fn is_u32(&self) {}
44     fn to_i32(self) {}
45     fn to_u32(&self) {}
46     fn from_i32(self) {}
47
48     pub fn as_i64(self) {}
49     pub fn into_i64(&self) {}
50     pub fn is_i64(self) {}
51     pub fn to_i64(self) {}
52     pub fn from_i64(self) {}
53
54     // test for false positives
55     fn as_(self) {}
56     fn into_(&self) {}
57     fn is_(self) {}
58     fn to_(self) {}
59     fn from_(self) {}
60 }