2020-02-04 16:03:37 -06:00
|
|
|
#![feature(const_trait_impl)]
|
|
|
|
|
|
|
|
struct S;
|
2022-08-28 01:27:31 -05:00
|
|
|
#[const_trait]
|
2020-02-04 16:03:37 -06:00
|
|
|
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
|
2020-02-04 16:03:37 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|