summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/trait-upcasting/upcast-through-struct-tail.rs
blob: 42495f45f8a65a8d5eb0e39c69f19a0a82b527a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// 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
    //~^ ERROR cannot cast `dyn A` to `dyn B`, trait upcasting coercion is experimental
}

fn main() {}