summaryrefslogtreecommitdiffstats
path: root/src/test/ui/reachable/expr_return_in_macro.rs
blob: 4e57618bf5e77cf3c242e12c242c9e675871de75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Tests that we generate nice error messages
// when an expression is unreachble due to control
// flow inside of a macro expansion.
#![deny(unreachable_code)]

macro_rules! early_return {
    () => {
        return ()
    }
}

fn main() {
    return early_return!();
    //~^ ERROR unreachable expression
}