summary refs log tree commit diff stats
path: root/tests/11-traits-generics-docs.rs
blob: 7d6ab6e9bd49c206275f3d01dcc8e49aa5550313 (plain) (blame)
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
// Checks that multiple `impl trait` in a row are valid, with generics and docs.

use impl_trait::impl_trait;

struct Foo<T>(T);
trait Bar {
}
trait Baz {
}

impl_trait! {
    impl<T> Foo<T> {
        /// ABC
        impl trait Bar {
        }
        /// DEF
        impl trait Baz {
        }
    }
}

fn static_assert_1<T: Bar>(_t: T) {}
fn static_assert_2<T: Baz>(_t: T) {}

fn main() {
    static_assert_1(Foo(()));
    static_assert_2(Foo(()));
}