summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/new-solver/param-candidate-doesnt-shadow-project.rs
blob: bdf999ec5dd00c17c10330209ec01f599fc49b87 (plain)
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
// compile-flags: -Ztrait-solver=next
// check-pass

trait Foo {
    type Assoc;
}

trait Bar {}

impl<T> Foo for T {
    type Assoc = i32;
}

impl<T> Bar for T where T: Foo<Assoc = i32> {}

fn require_bar<T: Bar>() {}

fn foo<T: Foo>() {
    // Unlike the classic solver, `<T as Foo>::Assoc = _` will still project
    // down to `i32` even though there's a param-env candidate here, since we
    // don't assemble any param-env projection candidates for `T: Foo` alone.
    require_bar::<T>();
}

fn main() {}