summaryrefslogtreecommitdiffstats
path: root/tests/ui/parser/attribute/multiple-tail-expr-behind-cfg.rs
blob: d97f24a3d29492140cca904c528983262ff14ba5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#![feature(stmt_expr_attributes)]

fn foo() -> String {
    #[cfg(feature = "validation")]
    [1, 2, 3].iter().map(|c| c.to_string()).collect::<String>() //~ ERROR expected `;`, found `#`
    #[cfg(not(feature = "validation"))]
    String::new()
}

fn bar() -> String {
    #[attr]
    [1, 2, 3].iter().map(|c| c.to_string()).collect::<String>() //~ ERROR expected `;`, found `#`
    #[attr] //~ ERROR cannot find attribute `attr` in this scope
    String::new()
}

fn main() {
    println!("{}", foo());
}