]> git.lizzy.rs Git - rust.git/blob - src/tools/rustfmt/tests/target/impl.rs
Merge commit 'd9ddce8a223cb9916389c039777b6966ea448dc8' into clippyup
[rust.git] / src / tools / rustfmt / tests / target / impl.rs
1 // Test impls
2
3 impl<T> JSTraceable for SmallVec<[T; 1]> {}
4
5 impl<K, V, NodeRef: Deref<Target = Node<K, V>>> Handle<NodeRef, handle::Edge, handle::Internal> {
6     // Keep this.
7 }
8
9 impl<V> Test<V>
10 where
11     V: Clone, // This comment is NOT removed by formatting!
12 {
13     pub fn new(value: V) -> Self {
14         Test {
15             cloned_value: value.clone(),
16             value,
17         }
18     }
19 }
20
21 impl X<T> /* comment */ {}
22 impl Y<T> // comment
23 {
24 }
25
26 impl<T> Foo for T
27 // comment1
28 where
29     // comment2
30     // blah
31     T: Clone,
32 {
33 }
34
35 // #1823
36 default impl Trait for X {}
37 default unsafe impl Trait for Y {}
38 pub default unsafe impl Trait for Z {}
39
40 // #2212
41 impl ConstWithDefault {
42     default const CAN_RECONSTRUCT_QUERY_KEY: bool = false;
43 }