blob: 7980bd1793f451c0bb8e8fbd5a2a966b83d594fd [file] [edit]
#![feature(const_trait_impl)]
#![feature(const_closures)]
// Regression test for https://github.com/rust-lang/rust/issues/153891
const trait Foo {
fn test() -> impl [const] Fn();
}
impl<T: Foo> Foo for &mut T {
const fn test() -> impl [const] Fn() {
//~^ ERROR functions in trait impls cannot be declared const
const move || {}
//~^ ERROR: cannot use `const` closures outside of const contexts
}
}
fn main() {}