rust/tests/ui/parser/issues/issue-48137-macros-cannot-interpolate-impl-items.rs

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

35 lines
370 B
Rust
Raw Normal View History

// check-pass
fn main() {}
macro_rules! mac_impl {
($i:item) => {
struct S;
impl S { $i }
}
}
mac_impl! {
fn foo() {}
}
macro_rules! mac_trait {
($i:item) => {
trait T { $i }
}
}
mac_trait! {
fn foo() {}
}
macro_rules! mac_extern {
($i:item) => {
extern "C" { $i }
}
}
mac_extern! {
fn foo();
}