about summary refs log tree commit diff
path: root/tests/ui/impl-trait/in-bindings/trait-failure.rs
blob: e4052437f2fae992d60d10cdb34dc64d0e603fdc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#![feature(impl_trait_in_bindings)]

trait Foo {}

struct W<T>(T);
impl<T> Foo for W<T> where T: Foo {}

fn main() {
    let x: impl Foo = W(());
    //~^ ERROR the trait bound `(): Foo` is not satisfied
    let x: W<impl Foo> = W(());
    //~^ ERROR the trait bound `(): Foo` is not satisfied
}