mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
22 lines
335 B
Rust
22 lines
335 B
Rust
#[repr(C)]
|
|
union PtrRepr<T: ?Sized> {
|
|
const_ptr: *const T,
|
|
mut_ptr: *mut T,
|
|
components: PtrComponents<T>,
|
|
//~^ ERROR the trait bound
|
|
}
|
|
|
|
#[repr(C)]
|
|
struct PtrComponents<T: Pointee + ?Sized> {
|
|
data_address: *const (),
|
|
metadata: <T as Pointee>::Metadata,
|
|
}
|
|
|
|
|
|
|
|
pub trait Pointee {
|
|
type Metadata;
|
|
}
|
|
|
|
fn main() {}
|