rust/tests/ui/traits/next-solver/pointee.rs

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

22 lines
462 B
Rust
Raw Normal View History

2023-12-14 06:11:28 -06:00
// compile-flags: -Znext-solver
2023-01-24 17:24:25 -06:00
// check-pass
#![feature(ptr_metadata)]
use std::ptr::{DynMetadata, Pointee};
trait Trait<U> {}
struct MyDst<T: ?Sized>(T);
fn meta_is<T: Pointee<Metadata = U> + ?Sized, U>() {}
2023-01-24 17:24:25 -06:00
fn works<T>() {
meta_is::<T, ()>();
meta_is::<[T], usize>();
meta_is::<str, usize>();
meta_is::<dyn Trait<T>, DynMetadata<dyn Trait<T>>>();
meta_is::<MyDst<T>, ()>();
meta_is::<((((([u8],),),),),), usize>();
2023-01-24 17:24:25 -06:00
}
fn main() {}