1
Fork 0

Remove #[default..] and add #[const_trait]

This commit is contained in:
Deadbeef 2022-03-16 20:49:54 +11:00 committed by Oli Scherer
parent f558990814
commit 257f06587c
30 changed files with 74 additions and 250 deletions

View file

@ -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) {}
}
}
}