2022-07-27 00:27:45 -05:00
|
|
|
#![feature(coerce_unsized)]
|
|
|
|
|
|
|
|
use std::any::Any;
|
|
|
|
use std::ops::CoerceUnsized;
|
|
|
|
|
2024-01-23 09:23:22 -06:00
|
|
|
struct Foo<T: ?Sized> {
|
2022-07-27 00:27:45 -05:00
|
|
|
data: Box<T>,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<T> CoerceUnsized<Foo<dyn Any>> for Foo<T> {}
|
|
|
|
//~^ ERROR the parameter type `T` may not live long enough
|
|
|
|
|
|
|
|
fn main() {}
|