summaryrefslogtreecommitdiffstats
path: root/tests/ui/rfc-2091-track-caller/mir-inlined-macro.rs
blob: a2e8eb27edeacbf58e967b8fc3efa0cd649ffd1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// run-pass
// revisions: default mir-opt
//[default] compile-flags: -Zinline-mir=no
//[mir-opt] compile-flags: -Zmir-opt-level=4

use std::panic::Location;

macro_rules! f {
    () => {
        Location::caller()
    };
}

#[inline(always)]
fn g() -> &'static Location<'static> {
    f!()
}

fn main() {
    let loc = g();
    assert_eq!(loc.line(), 16);
    assert_eq!(loc.column(), 5);
}