summary refs log tree commit diff stats
path: root/tests/14-where-on-trait.rs
blob: 56c7a4aaa1715800c682564d2ae7952eb1882f00 (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
// Checks that the impl trait can have where.

use impl_trait::impl_trait;

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

impl_trait! {
    impl<T> Foo<T> {
        impl trait<U> Bar<U> where Self: From<U> {
        }
    }
}
impl From<()> for Foo<()> {
    fn from(x: ()) -> Self {
        Self { 0: x }
    }
}

fn static_assert_1<T: Bar<U>, U>(_t: T, _u: U) {}

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