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
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue