]> git.lizzy.rs Git - rust.git/blob - tests/target/impls.rs
Merge pull request #1604 from topecongiro/comment-group
[rust.git] / tests / target / impls.rs
1 // rustfmt-normalize_comments: true
2 impl Foo for Bar {
3     fn foo() {
4         "hi"
5     }
6 }
7
8 pub impl Foo for Bar {
9     // Associated Constants
10     const Baz: i32 = 16;
11     // Associated Types
12     type FooBar = usize;
13     // Comment 1
14     fn foo() {
15         "hi"
16     }
17     // Comment 2
18     fn foo() {
19         "hi"
20     }
21     // Comment 3
22 }
23
24 pub unsafe impl<'a, 'b, X, Y: Foo<Bar>> !Foo<'a, X> for Bar<'b, Y>
25     where X: Foo<'a, Z>
26 {
27     fn foo() {
28         "hi"
29     }
30 }
31
32 impl<'a, 'b, X, Y: Foo<Bar>> Foo<'a, X> for Bar<'b, Y>
33     where X: Fooooooooooooooooooooooooooooo<'a, Z>
34 {
35     fn foo() {
36         "hi"
37     }
38 }
39
40 impl<'a, 'b, X, Y: Foo<Bar>> Foo<'a, X> for Bar<'b, Y>
41     where X: Foooooooooooooooooooooooooooo<'a, Z>
42 {
43     fn foo() {
44         "hi"
45     }
46 }
47
48 impl<T> Foo for Bar<T> where T: Baz {}
49
50 impl<T> Foo for Bar<T>
51     where T: Baz
52 {
53     // Comment
54 }
55
56 impl Foo {
57     fn foo() {}
58 }
59
60 impl Boo {
61     // BOO
62     fn boo() {}
63     // FOO
64 }
65
66 mod a {
67     impl Foo {
68         // Hello!
69         fn foo() {}
70     }
71 }
72
73
74 mod b {
75     mod a {
76         impl Foo {
77             fn foo() {}
78         }
79     }
80 }
81
82 impl Foo {
83     add_fun!();
84 }
85
86 impl Blah {
87     fn boop() {}
88     add_fun!();
89 }
90
91 impl X {
92     fn do_parse(mut self: X) {}
93 }
94
95 impl Y5000 {
96     fn bar(self: X<'a, 'b>, y: Y) {}
97
98     fn bad(&self, (x, y): CoorT) {}
99
100     fn turbo_bad(self: X<'a, 'b>, (x, y): CoorT) {}
101 }
102
103 pub impl<T> Foo for Bar<T>
104     where T: Foo
105 {
106     fn foo() {
107         "hi"
108     }
109 }
110
111 pub impl<T, Z> Foo for Bar<T, Z>
112     where T: Foo,
113           Z: Baz
114 {
115 }
116
117 mod m {
118     impl<T> PartialEq for S<T>
119         where T: PartialEq
120     {
121         fn eq(&self, other: &Self) {
122             true
123         }
124     }
125
126     impl<T> PartialEq for S<T> where T: PartialEq {}
127 }
128
129 impl<BorrowType, K, V, NodeType, HandleType> Handle<NodeRef<BorrowType, K, V, NodeType>,
130                                                     HandleType> {
131 }
132
133 impl<BorrowType, K, V, NodeType, HandleType> PartialEq
134     for Handle<NodeRef<BorrowType, K, V, NodeType>, HandleType> {
135 }
136
137 mod x {
138     impl<A, B, C, D> Foo
139         where A: 'static,
140               B: 'static,
141               C: 'static,
142               D: 'static
143     {
144     }
145 }
146
147 impl<ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNodeFoo>
148     Issue1249<ConcreteThreadSafeLayoutNode> {
149     // Creates a new flow constructor.
150     fn foo() {}
151 }
152
153 // #1600
154 impl<#[may_dangle] K, #[may_dangle] V> Drop for RawTable<K, V> {
155     fn drop() {}
156 }