//@ check-pass #![feature(const_deref)] #![feature(const_trait_impl)] use std::ops::Deref; struct Wrap(T); struct Foo; impl Foo { const fn call(&self) {} } impl const Deref for Wrap { type Target = T; fn deref(&self) -> &Self::Target { &self.0 } } const fn foo() { let x = Wrap(Foo); x.call(); } fn main() {}