2021-06-30 23:57:17 +08:00
|
|
|
#![feature(const_trait_impl)]
|
|
|
|
|
2022-03-16 20:49:54 +11:00
|
|
|
#[const_trait]
|
2021-06-30 23:57:17 +08:00
|
|
|
pub trait MyTrait {
|
2021-12-16 21:38:54 +08:00
|
|
|
fn defaulted_func(&self) {}
|
2021-06-30 23:57:17 +08:00
|
|
|
fn func(self);
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct NonConst;
|
|
|
|
|
|
|
|
impl MyTrait for NonConst {
|
|
|
|
fn func(self) {
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct Const;
|
|
|
|
|
|
|
|
impl const MyTrait for Const {
|
|
|
|
fn func(self) {
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|