summaryrefslogtreecommitdiffstats
path: root/tests/ui/parser/trailing-question-in-macro-type.rs
blob: e2a681ddd11155a07290586ddd46c14630fb8342 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
macro_rules! fn_expr {
    ($return_type:ty : $body:expr) => {
        (|| -> $return_type { $body })()
    };
    ($body:expr) => {
        (|| $body)()
    };
}


fn main() {
    fn_expr!{ o?.when(|&i| i > 0)?.when(|&i| i%2 == 0) };
    //~^ ERROR cannot find value `o` in this scope
}