about summary refs log tree commit diff
path: root/tests/ui/traits/resolve-impl-before-constrain-check.rs
blob: 87f9c241e402b860eb320cd4d3eecc8b7f17631b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Need a different module so we try to build the mir for `test`
// before analyzing `mod foo`.

mod foo {
    pub trait Callable {
        fn call();
    }

    impl<V: ?Sized> Callable for () {
    //~^ ERROR the type parameter `V` is not constrained by the impl trait, self type, or predicates
        fn call() {}
    }
}
use foo::*;

fn test() -> impl Sized {
    <() as Callable>::call()
}

fn main() {}