nit picks from review

This commit is contained in:
Maybe Waffle 2023-04-05 16:04:19 +00:00
parent b9d5a6b709
commit 48c16411c3

View File

@ -21,7 +21,7 @@
use rustc_hir_analysis::check::intrinsicck::InlineAsmCtxt; use rustc_hir_analysis::check::intrinsicck::InlineAsmCtxt;
use rustc_hir_analysis::check::potentially_plural_count; use rustc_hir_analysis::check::potentially_plural_count;
use rustc_hir_analysis::structured_errors::StructuredDiagnostic; 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::error_reporting::{FailureCode, ObligationCauseExt};
use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind}; use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
use rustc_infer::infer::TypeTrace; use rustc_infer::infer::TypeTrace;
@ -963,14 +963,11 @@ enum SuggestionText {
.map_or(true, |next_error| !matches!(next_error, Error::Extra(_))) .map_or(true, |next_error| !matches!(next_error, Error::Extra(_)))
{ {
let next = provided_arg_tys let next = provided_arg_tys
.get(arg_idx.plus(1)) .get(arg_idx + 1)
.map(|&(_, sp)| sp) .map(|&(_, sp)| sp)
.unwrap_or_else(|| { .unwrap_or_else(|| {
// Subtract one to move before `)` // Subtract one to move before `)`
call_expr call_expr.span.with_lo(call_expr.span.hi() - BytePos(1))
.span
.shrink_to_hi()
.with_lo(call_expr.span.hi() - BytePos(1))
}); });
// Include next comma // Include next comma