2024-10-29 17:51:38 +00:00
|
|
|
//@ aux-build:minicore.rs
|
|
|
|
|
//@ compile-flags: --crate-type=lib -Znext-solver
|
|
|
|
|
|
|
|
|
|
#![feature(no_core, const_trait_impl)]
|
|
|
|
|
#![no_std]
|
|
|
|
|
#![no_core]
|
|
|
|
|
|
|
|
|
|
extern crate minicore;
|
|
|
|
|
use minicore::*;
|
|
|
|
|
|
2025-03-11 12:08:45 +00:00
|
|
|
const fn call_indirect<T: [const] Fn()>(t: &T) { t() }
|
2024-10-29 17:51:38 +00:00
|
|
|
|
|
|
|
|
#[const_trait]
|
|
|
|
|
trait Foo {}
|
|
|
|
|
impl Foo for () {}
|
2025-03-11 12:08:45 +00:00
|
|
|
const fn foo<T: [const] Foo>() {}
|
2024-10-29 17:51:38 +00:00
|
|
|
|
|
|
|
|
const fn test() {
|
|
|
|
|
call_indirect(&foo::<()>);
|
2025-03-11 12:08:45 +00:00
|
|
|
//~^ ERROR the trait bound `(): [const] Foo` is not satisfied
|
2024-10-29 17:51:38 +00:00
|
|
|
}
|