//@ compile-flags: -Znext-solver //@ check-pass #![feature(const_trait_impl)] #![allow(refining_impl_trait)] #[const_trait] pub trait Foo { fn method(self) -> impl ~const Bar; } #[const_trait] pub trait Bar {} struct A(T); impl const Foo for A where A: ~const Bar { fn method(self) -> impl ~const Bar { self } } fn main() {}