mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
22 lines
323 B
Rust
22 lines
323 B
Rust
|
//@ known-bug: #54888
|
||
|
|
||
|
#![feature(unsize, coerce_unsized)]
|
||
|
|
||
|
use std::{
|
||
|
ops::CoerceUnsized,
|
||
|
marker::Unsize,
|
||
|
};
|
||
|
|
||
|
#[repr(C)]
|
||
|
struct Ptr<T: ?Sized>(Box<T>);
|
||
|
|
||
|
impl<T: ?Sized, U: ?Sized> CoerceUnsized<Ptr<U>> for Ptr<T>
|
||
|
where
|
||
|
T: Unsize<U>,
|
||
|
{}
|
||
|
|
||
|
|
||
|
fn main() {
|
||
|
let foo = Ptr(Box::new(5)) as Ptr<dyn std::any::Any>;
|
||
|
}
|