Remove #[default..]
and add #[const_trait]
This commit is contained in:
parent
f558990814
commit
257f06587c
30 changed files with 74 additions and 250 deletions
|
@ -2,28 +2,21 @@
|
|||
|
||||
#![feature(const_trait_impl)]
|
||||
|
||||
#[const_trait]
|
||||
trait Tr {
|
||||
fn req(&self);
|
||||
|
||||
fn prov(&self) {
|
||||
println!("lul");
|
||||
self.req();
|
||||
}
|
||||
|
||||
#[default_method_body_is_const]
|
||||
fn default() {}
|
||||
}
|
||||
|
||||
impl const Tr for u8 {
|
||||
fn req(&self) {}
|
||||
fn prov(&self) {}
|
||||
}
|
||||
|
||||
macro_rules! impl_tr {
|
||||
($ty: ty) => {
|
||||
impl const Tr for $ty {
|
||||
fn req(&self) {}
|
||||
fn prov(&self) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue