diff options
Diffstat (limited to 'tests/ui/mismatched_types/recovered-block.rs')
-rw-r--r-- | tests/ui/mismatched_types/recovered-block.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ui/mismatched_types/recovered-block.rs b/tests/ui/mismatched_types/recovered-block.rs new file mode 100644 index 000000000..b230b47d3 --- /dev/null +++ b/tests/ui/mismatched_types/recovered-block.rs @@ -0,0 +1,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() {} |