]> git.lizzy.rs Git - rust.git/blob - tests/target/impls.rs
Merge pull request #757 from ConnorGBrewster/fix-#650
[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     // Comment 3
17 }
18
19 pub unsafe impl<'a, 'b, X, Y: Foo<Bar>> !Foo<'a, X> for Bar<'b, Y>
20     where X: Foo<'a, Z>
21 {
22     fn foo() {
23         "hi"
24     }
25 }
26
27 impl<'a, 'b, X, Y: Foo<Bar>> Foo<'a, X> for Bar<'b, Y>
28     where X: Fooooooooooooooooooooooooooooo<'a, Z>
29 {
30     fn foo() {
31         "hi"
32     }
33 }
34
35 impl<'a, 'b, X, Y: Foo<Bar>> Foo<'a, X> for Bar<'b, Y>
36     where X: Foooooooooooooooooooooooooooo<'a, Z>
37 {
38     fn foo() {
39         "hi"
40     }
41 }
42
43 impl<T> Foo for Bar<T> where T: Baz {}
44
45 impl<T> Foo for Bar<T>
46     where T: Baz
47 {
48     // Comment
49 }
50
51 impl Foo {
52     fn foo() {}
53 }
54
55 impl Boo {
56     // BOO
57     fn boo() {}
58     // FOO
59 }
60
61 mod a {
62     impl Foo {
63         // Hello!
64         fn foo() {}
65     }
66 }
67
68
69 mod b {
70     mod a {
71         impl Foo {
72             fn foo() {}
73         }
74     }
75 }
76
77 impl Foo {
78     add_fun!();
79 }
80
81 impl Blah {
82     fn boop() {}
83     add_fun!();
84 }
85
86 impl X {
87     fn do_parse(mut self: X) {}
88 }
89
90 impl Y5000 {
91     fn bar(self: X<'a, 'b>, y: Y) {}
92 }
93
94 pub impl<T> Foo for Bar<T>
95     where T: Foo
96 {
97     fn foo() {
98         "hi"
99     }
100 }
101
102 pub impl<T, Z> Foo for Bar<T, Z>
103     where T: Foo,
104           Z: Baz
105 {
106 }