2018-08-30 12:18:55 +00:00
|
|
|
// run-pass
|
2018-08-31 13:02:01 +00:00
|
|
|
#![allow(non_camel_case_types)]
|
|
|
|
#![allow(non_snake_case)]
|
|
|
|
|
2015-06-16 18:49:01 +00:00
|
|
|
macro_rules! columnline {
|
|
|
|
() => (
|
|
|
|
(column!(), line!())
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
macro_rules! indirectcolumnline {
|
|
|
|
() => (
|
|
|
|
(||{ columnline!() })()
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let closure = || {
|
|
|
|
columnline!()
|
|
|
|
};
|
|
|
|
let iflet = if let Some(_) = Some(0) {
|
|
|
|
columnline!()
|
|
|
|
} else { (0, 0) };
|
|
|
|
let cl = columnline!();
|
2018-12-25 15:56:47 +00:00
|
|
|
assert_eq!(closure(), (9, 19));
|
|
|
|
assert_eq!(iflet, (9, 22));
|
|
|
|
assert_eq!(cl, (14, 24));
|
2015-06-16 18:49:01 +00:00
|
|
|
let indirect = indirectcolumnline!();
|
2018-12-25 15:56:47 +00:00
|
|
|
assert_eq!(indirect, (20, 28));
|
2015-06-16 18:49:01 +00:00
|
|
|
}
|