2021-12-24 03:41:18 -06:00
|
|
|
// run-pass
|
|
|
|
|
|
|
|
#![feature(ptr_metadata)]
|
|
|
|
|
|
|
|
use std::alloc::Layout;
|
|
|
|
use std::ptr::Pointee;
|
|
|
|
|
|
|
|
trait Foo {
|
|
|
|
type Bar;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Foo for () {
|
|
|
|
type Bar = ();
|
|
|
|
}
|
|
|
|
|
2022-07-25 15:36:03 -05:00
|
|
|
struct Wrapper1<T: Foo>(#[allow(unused_tuple_struct_fields)] <T as Foo>::Bar);
|
|
|
|
struct Wrapper2<T: Foo>(#[allow(unused_tuple_struct_fields)] <Wrapper1<T> as Pointee>::Metadata);
|
2021-12-24 03:41:18 -06:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let _: Wrapper2<()> = Wrapper2(());
|
|
|
|
let _ = Layout::new::<Wrapper2<()>>();
|
|
|
|
}
|