Rollup merge of #69583 - LeSeulArtichaut:ice-69378, r=Centril

Do not ICE on invalid type node after parse recovery

Closes #69378.
r? @estebank
This commit is contained in:
Yuki Okushi
2020-03-01 19:28:13 +09:00
committed by GitHub
3 changed files with 18 additions and 0 deletions
+1
View File
@@ -1312,6 +1312,7 @@ fn report_unknown_field(
ty_span: Span,
) {
if variant.recovered {
self.set_tainted_by_errors();
return;
}
let mut err = self.type_error_struct_with_diag(
@@ -0,0 +1,9 @@
// Regression test for #69378: no type for node after struct parse recovery
struct Foo { 0: u8 } //~ ERROR expected identifier
fn test(f: Foo) {
Foo{foo: 4, ..f};
}
fn main() {}
@@ -0,0 +1,8 @@
error: expected identifier, found `0`
--> $DIR/issue-69378-ice-on-invalid-type-node-after-recovery.rs:3:14
|
LL | struct Foo { 0: u8 }
| ^ expected identifier
error: aborting due to previous error