rust/tests/ui/rfcs/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.rs

17 lines
217 B
Rust
Raw Normal View History

2023-08-06 13:20:55 +00:00
#![feature(const_trait_impl, effects)]
struct S;
2022-08-28 06:27:31 +00:00
#[const_trait]
trait T {
fn foo();
}
fn non_const() {}
impl const T for S {
fn foo() { non_const() }
2021-12-10 01:10:05 +08:00
//~^ ERROR cannot call non-const fn
}
fn main() {}