Rollup merge of #105267 - compiler-errors:issue-104613, r=oli-obk
Don't ICE in ExprUseVisitor on FRU for non-existent struct Fixes #104613 Fixes #105202
This commit is contained in:
commit
3bcfa4c459
13 changed files with 85 additions and 19 deletions
|
@ -704,7 +704,7 @@ impl<'tcx> Cx<'tcx> {
|
|||
hir::ExprKind::Field(ref source, ..) => ExprKind::Field {
|
||||
lhs: self.mirror_expr(source),
|
||||
variant_index: VariantIdx::new(0),
|
||||
name: Field::new(tcx.field_index(expr.hir_id, self.typeck_results)),
|
||||
name: Field::new(self.typeck_results.field_index(expr.hir_id)),
|
||||
},
|
||||
hir::ExprKind::Cast(ref source, ref cast_ty) => {
|
||||
// Check for a user-given type annotation on this `cast`
|
||||
|
@ -1079,7 +1079,7 @@ impl<'tcx> Cx<'tcx> {
|
|||
fields
|
||||
.iter()
|
||||
.map(|field| FieldExpr {
|
||||
name: Field::new(self.tcx.field_index(field.hir_id, self.typeck_results)),
|
||||
name: Field::new(self.typeck_results.field_index(field.hir_id)),
|
||||
expr: self.mirror_expr(field.expr),
|
||||
})
|
||||
.collect()
|
||||
|
|
|
@ -321,7 +321,7 @@ impl<'a, 'tcx> PatCtxt<'a, 'tcx> {
|
|||
let subpatterns = fields
|
||||
.iter()
|
||||
.map(|field| FieldPat {
|
||||
field: Field::new(self.tcx.field_index(field.hir_id, self.typeck_results)),
|
||||
field: Field::new(self.typeck_results.field_index(field.hir_id)),
|
||||
pattern: self.lower_pattern(&field.pat),
|
||||
})
|
||||
.collect();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue