]> git.lizzy.rs Git - rust.git/blob - tests/ui/impl.rs
Stabilize tool lints
[rust.git] / tests / ui / impl.rs
1 // Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution.
3 //
4 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
5 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
7 // option. This file may not be copied, modified, or distributed
8 // except according to those terms.
9
10
11
12
13 #![allow(dead_code)]
14 #![warn(clippy::multiple_inherent_impl)]
15
16 struct MyStruct;
17
18 impl MyStruct {
19     fn first() {}
20 }
21
22 impl MyStruct {
23     fn second() {}
24 }
25
26 impl<'a> MyStruct {
27     fn lifetimed() {}
28 }
29
30 mod submod {
31     struct MyStruct;
32     impl MyStruct {
33         fn other() {}
34     }
35
36     impl super::MyStruct {
37         fn third() {}
38     }
39 }
40
41 use std::fmt;
42 impl fmt::Debug for MyStruct {
43     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
44         write!(f, "MyStruct {{ }}")
45     }
46 }
47
48 fn main() {}