about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMaybe Waffle <waffle.lapkin@gmail.com>2023-04-05 16:04:19 +0000
committerMaybe Waffle <waffle.lapkin@gmail.com>2023-04-05 16:04:19 +0000
commit48c16411c31d27772cb9c05a9914c2b9a26b5df5 (patch)
tree7ac1779dd36ac166bd7a88471dc70392e8477213
parentb9d5a6b709be1e21961f2a867d6e6542ffa557f2 (diff)
downloadrust-48c16411c31d27772cb9c05a9914c2b9a26b5df5.tar.gz
rust-48c16411c31d27772cb9c05a9914c2b9a26b5df5.zip
nit picks from review
-rw-r--r--compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs9
1 files changed, 3 insertions, 6 deletions
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::astconv::AstConv;
 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 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                                 .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