//@ check-pass //@ compile-flags: -Zunpretty=expanded #![feature(derive_smart_pointer)] use std::marker::SmartPointer; pub trait MyTrait {} #[derive(SmartPointer)] #[repr(transparent)] struct MyPointer<'a, #[pointee] T: ?Sized> { ptr: &'a T, } #[derive(core::marker::SmartPointer)] #[repr(transparent)] pub struct MyPointer2<'a, Y, Z: MyTrait, #[pointee] T: ?Sized + MyTrait, X: MyTrait = ()> where Y: MyTrait, { data: &'a mut T, x: core::marker::PhantomData, } #[derive(SmartPointer)] #[repr(transparent)] struct MyPointerWithoutPointee<'a, T: ?Sized> { ptr: &'a T, }