Files
rust/tests/ui/traits/const-traits/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
394 B
Rust
Raw Normal View History

2024-06-30 17:08:45 +00:00
//@ compile-flags: -Znext-solver
2024-10-30 18:03:44 +00: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() })();
2024-12-23 21:49:48 +00:00
//~^ ERROR: cannot call non-const method `<() as Foo>::foo` in constant functions
// FIXME(const_trait_impl) this should probably say constant closures
}