2021-10-11 12:20:20 -05:00
|
|
|
// check-pass
|
|
|
|
|
|
|
|
#![feature(const_trait_impl)]
|
|
|
|
|
2022-03-16 04:49:54 -05:00
|
|
|
#[const_trait]
|
2021-10-11 12:20:20 -05:00
|
|
|
trait Tr {
|
|
|
|
fn req(&self);
|
|
|
|
|
|
|
|
fn default() {}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl const Tr for u8 {
|
|
|
|
fn req(&self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
macro_rules! impl_tr {
|
|
|
|
($ty: ty) => {
|
|
|
|
impl const Tr for $ty {
|
|
|
|
fn req(&self) {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl_tr!(u64);
|
|
|
|
|
|
|
|
fn main() {}
|