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:
commit
9801696214
@ -1312,6 +1312,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user