summary refs log tree commit diff
path: root/src/test/ui/malformed/malformed-interpolated.rs
blob: 5101b5caeea09c31df69bf6a56586e7979b02bf2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#![feature(rustc_attrs)]

macro_rules! check {
    ($expr: expr) => (
        #[rustc_dummy = $expr] //~ ERROR unexpected token: `-0`
                               //~| ERROR unexpected token: `0 + 0`
        use main as _;
    );
}

check!("0"); // OK
check!(0); // OK
check!(0u8); //~ ERROR suffixed literals are not allowed in attributes
check!(-0); // ERROR, see above
check!(0 + 0); // ERROR, see above

fn main() {}