summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/new-solver/dont-normalize-proj-with-error.rs
blob: 19a6fa990ff147757d166cc03522f01b395e45c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// compile-flags: -Ztrait-solver=next

// Test that we don't incorrectly leak unconstrained inference variables
// if the projection contained an error. This caused an ICE in writeback.

trait Mirror {
    type Assoc: ?Sized;
}

struct Wrapper<T: ?Sized>(T);
impl<T: ?Sized> Mirror for Wrapper<T> {
    type Assoc = T;
}

fn mirror<W: Mirror>(_: W) -> Box<W::Assoc> { todo!() }

fn type_error() -> TypeError { todo!() }
//~^ ERROR cannot find type `TypeError` in this scope

fn main() {
    let x = mirror(type_error());
}