1
Fork 0

drive-by: move field_index to typeck results

This commit is contained in:
Michael Goulet 2022-12-04 17:59:21 +00:00
parent 19c250aa12
commit 26b24cd755
8 changed files with 23 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,