//@ known-bug: #138564 //@compile-flags: -Copt-level=0 -Cdebuginfo=2 --crate-type lib #![feature(unsize, dispatch_from_dyn, arbitrary_self_types)] use std::marker::Unsize; use std::ops::{Deref, DispatchFromDyn}; #[repr(align(16))] pub struct MyPointer(*const T); impl, U: ?Sized> DispatchFromDyn> for MyPointer {} impl Deref for MyPointer { type Target = T; fn deref(&self) -> &T { unimplemented!() } } pub trait Trait { fn foo(self: MyPointer) {} } // make sure some usage of `::foo` makes it to codegen pub fn user() -> *const () { ::foo as *const () }