rust/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/const_closure-const_trait_impl-ice-113381.rs
Matthias Krüger 384f7382ba add test for #113381
Fixes #113381

r? fee1-dead
2023-11-02 15:59:54 +01:00

16 lines
251 B
Rust

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