summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/ice-with-dyn-pointee-errors.rs
blob: 46cef2c8bc094fc745f01a710b43da2bc6132e24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#![feature(ptr_metadata)]
// Address issue #112737 -- ICE with dyn Pointee
extern crate core;
use core::ptr::Pointee;

fn unknown_sized_object_ptr_in(_: &(impl Pointee<Metadata = ()> + ?Sized)) {}

fn raw_pointer_in(x: &dyn Pointee<Metadata = ()>) {
    unknown_sized_object_ptr_in(x)
    //~^ ERROR type mismatch resolving `<dyn Pointee<Metadata = ()> as Pointee>::Metadata == ()`
}

fn main() {
    raw_pointer_in(&42)
}