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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
208 B
Rust
Raw Normal View History

#![feature(const_trait_impl)]
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-09 17:10:05 +00:00
//~^ ERROR cannot call non-const fn
}
fn main() {}