2024-10-21 20:16:33 +00:00
|
|
|
//@ compile-flags: -Znext-solver
|
|
|
|
|
//@ edition:2021
|
|
|
|
|
|
2024-10-30 18:03:44 +00:00
|
|
|
#![feature(const_trait_impl, const_closures)]
|
2024-10-21 20:16:33 +00:00
|
|
|
#![allow(incomplete_features)]
|
|
|
|
|
|
|
|
|
|
#[const_trait]
|
|
|
|
|
trait Bar {
|
|
|
|
|
fn foo(&self);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl Bar for () {
|
|
|
|
|
fn foo(&self) {}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const FOO: () = {
|
|
|
|
|
(const || ().foo())();
|
2025-03-11 12:08:45 +00:00
|
|
|
//~^ ERROR the trait bound `(): [const] Bar` is not satisfied
|
2024-11-01 18:49:08 +00:00
|
|
|
// FIXME(const_trait_impl): The constness environment for const closures is wrong.
|
2024-10-21 20:16:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
fn main() {}
|