rust/tests/ui/traits/next-solver/coerce-ambig-alias-to-rigid-alias.rs
2024-02-16 20:02:50 +00:00

16 lines
318 B
Rust

//@ compile-flags: -Znext-solver
//@ check-pass
trait Trait {
type Assoc;
}
fn call<T: Trait>(_: <T as Trait>::Assoc, _: T) {}
fn foo<T: Trait>(rigid: <T as Trait>::Assoc, t: T) {
// Check that we can coerce `<?0 as Trait>::Assoc` to `<T as Trait>::Assoc`.
call::<_ /* ?0 */>(rigid, t);
}
fn main() {}