summaryrefslogtreecommitdiffstats
path: root/src/tools/rustfmt/tests/target/attrib-block-expr.rs
blob: 1e9557dc039edcdc4fc8b5d77930c51459ee9d2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
fn issue_2073() {
    let x = {
        #![my_attr]
        do_something()
    };

    let x = #[my_attr]
    {
        do_something()
    };

    let x = #[my_attr]
    {};

    {
        #![just_an_attribute]
    };

    let z = #[attr1]
    #[attr2]
    {
        body()
    };

    x = |y| {
        #![inner]
    };

    x = |y| #[outer]
    {};

    x = |y| {
        //! ynot
    };

    x = |y| #[outer]
    unsafe {};

    let x = unsafe {
        #![my_attr]
        do_something()
    };

    let x = #[my_attr]
    unsafe {
        do_something()
    };

    // This is a dumb but possible case
    let x = #[my_attr]
    unsafe {};

    x = |y| #[outer]
    #[outer2]
    unsafe {
        //! Comment
    };
}