diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs index bb1063538b4..b02eae19fce 100644 --- a/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs +++ b/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs @@ -21,7 +21,7 @@ use rustc_hir_analysis::check::intrinsicck::InlineAsmCtxt; use rustc_hir_analysis::check::potentially_plural_count; use rustc_hir_analysis::structured_errors::StructuredDiagnostic; -use rustc_index::vec::{Idx, IndexVec}; +use rustc_index::vec::IndexVec; use rustc_infer::infer::error_reporting::{FailureCode, ObligationCauseExt}; use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind}; use rustc_infer::infer::TypeTrace; @@ -963,14 +963,11 @@ enum SuggestionText { .map_or(true, |next_error| !matches!(next_error, Error::Extra(_))) { let next = provided_arg_tys - .get(arg_idx.plus(1)) + .get(arg_idx + 1) .map(|&(_, sp)| sp) .unwrap_or_else(|| { // Subtract one to move before `)` - call_expr - .span - .shrink_to_hi() - .with_lo(call_expr.span.hi() - BytePos(1)) + call_expr.span.with_lo(call_expr.span.hi() - BytePos(1)) }); // Include next comma