about summary refs log tree commit diff
path: root/tests/ui/traits/next-solver/coercion/non-wf-in-coerce-pointers.rs
blob: d05def2cb757dcd41faec281117d4beade047a83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//@ compile-flags: -Znext-solver

trait Wf {
    type Assoc;
}

struct S {
    f: &'static <() as Wf>::Assoc,
    //~^ ERROR the trait bound `(): Wf` is not satisfied
}

fn main() {
    let x: S = todo!();
    let y: &() = x.f;
    //~^ ERROR mismatched types
    //~| ERROR the trait bound `(): Wf` is not satisfied
}