]> git.proxmox.com Git - rustc.git/blame - tests/ui/traits/new-solver/param-candidate-doesnt-shadow-project.rs
New upstream version 1.75.0+dfsg1
[rustc.git] / tests / ui / traits / new-solver / param-candidate-doesnt-shadow-project.rs
CommitLineData
9ffffee4
FG
1// compile-flags: -Ztrait-solver=next
2// check-pass
3
4trait Foo {
5 type Assoc;
6}
7
8trait Bar {}
9
10impl<T> Foo for T {
11 type Assoc = i32;
12}
13
14impl<T> Bar for T where T: Foo<Assoc = i32> {}
15
16fn require_bar<T: Bar>() {}
17
18fn foo<T: Foo>() {
19 // Unlike the classic solver, `<T as Foo>::Assoc = _` will still project
20 // down to `i32` even though there's a param-env candidate here, since we
21 // don't assemble any param-env projection candidates for `T: Foo` alone.
22 require_bar::<T>();
23}
24
25fn main() {}