summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/target/impl.rs
blob: f37fbcf1fcbcc607d3bd6890f90d3c3168b87390 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Test impls

impl<T> JSTraceable for SmallVec<[T; 1]> {}

impl<K, V, NodeRef: Deref<Target = Node<K, V>>> Handle<NodeRef, handle::Edge, handle::Internal> {
    // Keep this.
}

impl<V> Test<V>
where
    V: Clone, // This comment is NOT removed by formatting!
{
    pub fn new(value: V) -> Self {
        Test {
            cloned_value: value.clone(),
            value,
        }
    }
}

impl X<T> /* comment */ {}
impl Y<T> // comment
{
}

impl<T> Foo for T
// comment1
where
    // comment2
    // blah
    T: Clone,
{
}

// #1823
default impl Trait for X {}
default unsafe impl Trait for Y {}
pub default unsafe impl Trait for Z {}

// #2212
impl ConstWithDefault {
    default const CAN_RECONSTRUCT_QUERY_KEY: bool = false;
}