//@ known-bug: #111883 #![crate_type = "lib"] #![feature(arbitrary_self_types, no_core, lang_items)] #![no_core] #[lang = "sized"] trait Sized {} #[lang = "copy"] trait Copy {} #[lang = "receiver"] trait Receiver {} #[lang = "dispatch_from_dyn"] trait DispatchFromDyn {} impl<'a, T: ?Sized + Unsize, U: ?Sized> DispatchFromDyn<&'a U> for &'a T {} #[lang = "unsize"] trait Unsize {} #[lang = "coerce_unsized"] pub trait CoerceUnsized {} impl<'a, 'b: 'a, T: ?Sized + Unsize, U: ?Sized> CoerceUnsized<&'a U> for &'b T {} #[lang = "drop_in_place"] fn drop_in_place_fn(a: &dyn Trait2) {} pub trait Trait1 { fn foo(&self); } pub struct Type1; impl Trait1 for Type1 { fn foo(&self) {} } pub trait Trait2 {} pub fn bar1() { let a = Type1; let b = &a as &dyn Trait1; b.foo(); }