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:
Matthias Krüger
2022-12-07 15:39:06 +01:00
committed by GitHub
13 changed files with 85 additions and 19 deletions

View File

@@ -2142,10 +2142,6 @@ impl<'tcx> TyCtxt<'tcx> {
}
}
pub fn field_index(self, hir_id: hir::HirId, typeck_results: &TypeckResults<'_>) -> usize {
typeck_results.field_indices().get(hir_id).cloned().expect("no index for a field")
}
pub fn find_field_index(self, ident: Ident, variant: &VariantDef) -> Option<usize> {
variant
.fields