2023-08-06 13:20:55 +00:00
|
|
|
#![feature(const_trait_impl, effects)]
|
2020-02-04 14:03:37 -08:00
|
|
|
|
|
|
|
struct S;
|
2022-08-28 06:27:31 +00:00
|
|
|
#[const_trait]
|
2020-02-04 14:03:37 -08:00
|
|
|
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
|
2020-02-04 14:03:37 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|