about summary refs log tree commit diff
path: root/tests/ui/attributes/decl_macro_ty_in_attr_macro.rs
blob: e633c08be3ad2ac3190215580ecae62c11a863b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// tests for #137662: using a ty or (or most other) fragment inside an attr macro wouldn't work
// because of a missing code path. With $repr: tt it did work.
//@ check-pass

macro_rules! foo {
    {
        $repr:ty
    } => {
        #[repr($repr)]
        pub enum Foo {
            Bar = 0i32,
        }
    }
}

foo! {
    i32
}

fn main() {}