rust/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/const_closure-const_trait_impl-ice-113381.rs

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

18 lines
319 B
Rust
Raw Normal View History

2023-12-18 22:28:21 -06:00
// check-pass
// FIXME(effects) this shouldn't pass
#![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() })();
2023-12-18 22:28:21 -06:00
// FIXME(effects) ~^ ERROR: cannot call non-const fn
}