summaryrefslogtreecommitdiffstats
path: root/src/test/ui/mismatched_types/recovered-block.rs
blob: b230b47d35d37d08451e1e73cbbc1c189565b3a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use std::env;

pub struct Foo {
    text: String
}

pub fn foo() -> Foo {
    let args: Vec<String> = env::args().collect();
    let text = args[1].clone();

    pub Foo { text }
}
//~^^ ERROR missing `struct` for struct definition

pub fn bar() -> Foo {
    fn
    Foo { text: "".to_string() }
}
//~^^ ERROR expected one of `(` or `<`, found `{`

fn main() {}