Skip to content

Commit ce65294

Browse files
committed
Use args.args[0]
1 parent e1f05d2 commit ce65294

File tree

1 file changed

+2
-7
lines changed
  • compiler/rustc_hir_analysis/src/hir_ty_lowering

1 file changed

+2
-7
lines changed

compiler/rustc_hir_analysis/src/hir_ty_lowering/generics.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -616,12 +616,7 @@ pub(crate) fn prohibit_explicit_late_bound_lifetimes(
616616
let msg = "cannot specify lifetime arguments explicitly \
617617
if late bound lifetime parameters are present";
618618
let note = "the late bound lifetime parameter is introduced here";
619-
let Some(first_lifetime_arg) =
620-
args.args.iter().find(|arg| matches!(arg, GenericArg::Lifetime(_)))
621-
else {
622-
return ExplicitLateBound::No;
623-
};
624-
let span = first_lifetime_arg.span();
619+
let span = args.args[0].span();
625620

626621
if position == GenericArgPosition::Value
627622
&& args.num_lifetime_params() != param_counts.lifetimes
@@ -634,7 +629,7 @@ pub(crate) fn prohibit_explicit_late_bound_lifetimes(
634629
multispan.push_span_label(span_late, note);
635630
cx.tcx().node_span_lint(
636631
LATE_BOUND_LIFETIME_ARGUMENTS,
637-
first_lifetime_arg.hir_id(),
632+
args.args[0].hir_id(),
638633
multispan,
639634
|lint| {
640635
lint.primary_message(msg);

0 commit comments

Comments
 (0)