]> git.lizzy.rs Git - rust.git/blob - tests/target/impls.rs
Fix a bug with nested impls
[rust.git] / tests / target / impls.rs
1 impl Foo for Bar {
2     fn foo() {
3         "hi"
4     }
5 }
6
7 pub impl Foo for Bar {
8     // Comment 1
9     fn foo() {
10         "hi"
11     }
12     // Comment 2
13     fn foo() {
14         "hi"
15     }
16 }
17
18 pub unsafe impl<'a, 'b, X, Y: Foo<Bar>> !Foo<'a, X> for Bar<'b, Y> where X: Foo<'a, Z>
19 {
20     fn foo() {
21         "hi"
22     }
23 }
24
25 impl<'a, 'b, X, Y: Foo<Bar>> Foo<'a, X> for Bar<'b, Y>
26     where X: Fooooooooooooooooooooooooooooo<'a, Z>
27 {
28     fn foo() {
29         "hi"
30     }
31 }
32
33 impl<'a, 'b, X, Y: Foo<Bar>> Foo<'a, X> for Bar<'b, Y> where X: Foooooooooooooooooooooooooooo<'a, Z>
34 {
35     fn foo() {
36         "hi"
37     }
38 }
39
40 impl Foo {
41     fn foo() {}
42 }
43
44 mod a {
45     impl Foo {
46         // Hello!
47         fn foo() {}
48     }
49 }
50
51
52 mod b {
53     mod a {
54         impl Foo {
55             fn foo() {}
56         }
57     }
58 }