]> git.lizzy.rs Git - rust.git/blob - src/test/ui/mismatched_types/recovered-block.rs
Auto merge of #75936 - sdroege:chunks-exact-construction-bounds-check, r=nagisa
[rust.git] / src / test / ui / mismatched_types / recovered-block.rs
1 // ignore-cloudabi no std::env support
2
3 use std::env;
4
5 pub struct Foo {
6     text: String
7 }
8
9 pub fn foo() -> Foo {
10     let args: Vec<String> = env::args().collect();
11     let text = args[1].clone();
12
13     pub Foo { text }
14 }
15 //~^^ ERROR missing `struct` for struct definition
16
17 pub fn bar() -> Foo {
18     fn
19     Foo { text: "".to_string() }
20 }
21 //~^^ ERROR expected one of `(` or `<`, found `{`
22
23 fn main() {}