rust/tests/ui/hygiene/issue-44128.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
267 B
Rust
Raw Normal View History

// check-pass
#![allow(unused_must_use)]
2017-12-07 16:15:55 -06: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();
}