rust/tests/ui/traits/new-solver/upcast-right-substs.rs
Urgau 4c2d6de70e Stabilize RFC3324 dyn upcasting coercion
Aka trait_upcasting feature.

And also adjust the `deref_into_dyn_supertrait` lint.
2023-11-22 13:56:36 +01:00

13 lines
210 B
Rust

// compile-flags: -Ztrait-solver=next
// check-pass
trait Foo: Bar<i32> + Bar<u32> {}
trait Bar<T> {}
fn main() {
let x: &dyn Foo = todo!();
let y: &dyn Bar<i32> = x;
let z: &dyn Bar<u32> = x;
}