summary refs log tree commit diff
path: root/tests/ui/traits/pointee-tail-is-generic-errors.rs
blob: 8ddac5b2f3964aa16ab5d997ad9457aece7927f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//@ edition:2018

#![feature(ptr_metadata)]
#![feature(type_alias_impl_trait)]

type Opaque = impl std::fmt::Debug + ?Sized;

#[define_opaque(Opaque)]
fn opaque() -> &'static Opaque {
    &[1] as &[i32]
}

fn a<T: ?Sized>() {
    is_thin::<T>();
    //~^ ERROR type mismatch resolving `<T as Pointee>::Metadata == ()`

    is_thin::<Opaque>();
    //~^ ERROR type mismatch resolving `<Opaque as Pointee>::Metadata == ()`
}

fn is_thin<T: std::ptr::Pointee<Metadata = ()> + ?Sized>() {}

fn main() {}