summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/new-solver/pointee.rs
blob: 93c0542ace4bff372fd47f37bbe57b2e9ef1207e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// compile-flags: -Ztrait-solver=next
// 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>() {}

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>();
}

fn main() {}