rust/tests/ui/rfc-2632-const-trait-impl/non-const-op-const-closure-non-const-outer.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
242 B
Rust
Raw Normal View History

2022-12-22 01:19:15 -06:00
#![feature(const_closures, const_trait_impl)]
#![allow(incomplete_features)]
trait Foo {
fn foo(&self);
}
impl Foo for () {
fn foo(&self) {}
}
fn main() {
(const || { (()).foo() })();
//~^ ERROR: cannot call non-const fn
}