rust/tests/ui/traits/const-traits/const-check-fns-in-const-impl.rs

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

19 lines
248 B
Rust
Raw Normal View History

2024-10-21 19:37:48 +00:00
//@ compile-flags: -Znext-solver
2024-10-30 18:03:44 +00:00
#![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() }
2024-12-23 21:49:48 +00:00
//~^ ERROR cannot call non-const function
}
fn main() {}