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)]
|
2023-10-25 23:19:34 +02:00
|
|
|
#![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
|
2024-11-01 18:49:08 +00:00
|
|
|
// FIXME(const_trait_impl) this should probably say constant closures
|
2023-10-25 23:19:34 +02:00
|
|
|
}
|