rust/tests/ui/traits/trait-upcasting/upcast-through-struct-tail.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

15 lines
236 B
Rust

// check-pass
// revisions: current next
//[next] compile-flags: -Ztrait-solver=next
struct Wrapper<T: ?Sized>(T);
trait A: B {}
trait B {}
fn test<'a>(x: Box<Wrapper<dyn A + 'a>>) -> Box<Wrapper<dyn B + 'a>> {
x
}
fn main() {}