1
Fork 0

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
commit 3bcfa4c459
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 85 additions and 19 deletions

View file

@ -259,7 +259,7 @@ impl<'tcx> LateLintPass<'tcx> for NonShorthandFieldPatterns {
}
if let PatKind::Binding(binding_annot, _, ident, None) = fieldpat.pat.kind {
if cx.tcx.find_field_index(ident, &variant)
== Some(cx.tcx.field_index(fieldpat.hir_id, cx.typeck_results()))
== Some(cx.typeck_results().field_index(fieldpat.hir_id))
{
cx.struct_span_lint(
NON_SHORTHAND_FIELD_PATTERNS,