summaryrefslogtreecommitdiff
path: root/samples/test/misc_macro_issues.rs
blob: 4d884166ba774d38336d0d3c5bf9822c061f86e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// compile-flags: --test

// #55 - Doesn't allow macros for :item
macro_rules! outer {
    ($it:item) => {}
}
outer! {
    inner! {}
}

// #59 - 
macro_rules! outer2 {
    ({ $($x:item)* }) => {}
}
outer2! {
    {inner!{}}
}


// #56 - Unexpanded macro in type
macro_rules! m {
    ($tt:tt) => { $tt }
}

struct A;
struct B;

impl From<m!(A)> for B {
    fn from(_: A) -> B {
        unimplemented!()
    }
}