about summary refs log tree commit diff
path: root/tests/ui/lint/lint-double-negations-macro.rs
blob: a6583271d5a2ab4989c0030d08ce54314fb32c85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//@ check-pass
macro_rules! neg {
    ($e: expr) => {
        -$e
    };
}
macro_rules! bad_macro {
    ($e: expr) => {
        --$e //~ WARN use of a double negation
    };
}

fn main() {
    neg!(-1);
    bad_macro!(1);
}