2023-07-28 20:04:04 -05:00
|
|
|
// revisions: current next
|
2023-12-14 06:11:28 -06:00
|
|
|
//[next] compile-flags: -Znext-solver
|
2023-07-28 20:04:04 -05:00
|
|
|
|
|
|
|
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
|
2024-01-22 06:23:50 -06:00
|
|
|
//~^ ERROR cannot cast `dyn A` to `dyn B`, trait upcasting coercion is experimental
|
2023-07-28 20:04:04 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|