summaryrefslogtreecommitdiffstats
path: root/tests/ui/type/binding-assigned-block-without-tail-expression.rs
blob: 09afd27a079ba6111003e9181a9c949950e41018 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
struct S;
fn main() {
    let x = {
        println!("foo");
        42;
    };
    let y = {};
    let z = {
        "hi";
    };
    let s = {
        S;
    };
    println!("{}", x); //~ ERROR E0277
    println!("{}", y); //~ ERROR E0277
    println!("{}", z); //~ ERROR E0277
    println!("{}", s); //~ ERROR E0277
    let _: i32 = x; //~ ERROR E0308
    let _: i32 = y; //~ ERROR E0308
    let _: i32 = z; //~ ERROR E0308
    let _: i32 = s; //~ ERROR E0308
}