2019-07-14 11:34:13 +01:00
|
|
|
//@ check-pass
|
2018-09-25 23:51:35 +02:00
|
|
|
#![allow(unused_must_use)]
|
2017-12-07 14:15:55 -08:00
|
|
|
#![feature(decl_macro)]
|
|
|
|
|
|
|
|
|
|
pub macro create_struct($a:ident) {
|
|
|
|
|
struct $a;
|
|
|
|
|
impl Clone for $a {
|
|
|
|
|
fn clone(&self) -> Self {
|
|
|
|
|
$a
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
create_struct!(Test);
|
|
|
|
|
Test.clone();
|
|
|
|
|
}
|