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 01:27:31 -05:00
#[const_trait]
trait T {
fn foo();
}
fn non_const() {}
impl const T for S {
fn foo() { non_const() }
2021-12-09 11:10:05 -06:00
//~^ ERROR cannot call non-const fn
}
fn main() {}