rust/tests/ui/coercion/issue-53475.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
246 B
Rust
Raw Normal View History

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