Split impl-with-default-fn test into a pass test and a fail test
This commit is contained in:
parent
de940fc725
commit
0a03f8c78b
3 changed files with 38 additions and 8 deletions
|
@ -0,0 +1,34 @@
|
|||
// check-pass
|
||||
|
||||
#![feature(const_trait_impl)]
|
||||
#![feature(const_fn_trait_bound)]
|
||||
|
||||
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) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl_tr!(u64);
|
||||
|
||||
fn main() {}
|
Loading…
Add table
Add a link
Reference in a new issue