Change:
<!-- Thank you for filing a bug report! Please provide a short summary of the bug, along with any information you feel relevant to replicating the bug. If you cannot produce a minimal reproduction case (something that would work in isolation), please provide the steps or even link to a repository that causes the problematic output to occur. --Given the following code: <!-- Please provide a link to --The current output is: Rustfix will fail to apply this: ` So we need to extend span to include the as well? <!-- TRIAGEBOTSTART --<!-- TRIAGEBOTASSIGNSTART --<!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --<!-- TRIAGEBOTASSIGNEND --<!-- TRIAGEBOTEND --
The relevant code is in , with . The should be computed using in the loop, instead of crafting a specific computation. Likewise, should use method. If using those 2 methods from is not enough to solve the issue, those methods should perhaps be adapted.
claim
release-assignment Haven't been able to focus on this. Releasing assignment.
claim
Progress report: I'm working on it.
claim

Discussion:
} let ty_generics = cx.tcx.generics_of(def_id); <ins> let num_where_predicates = hir_generics .predicates .iter() .filter(|predicate| predicate.in_where_clause()) .count(); </ins> let mut bound_count = 0; let mut lint_spans = Vec::new(); let mut where_lint_spans = Vec::new(); <del> let mut dropped_predicate_count = 0; let num_predicates = hir_generics.predicates.len(); </del> <ins> let mut dropped_where_predicate_count = 0; </ins> for (i, where_predicate) in hir_generics.predicates.iter().enumerate() { let (relevant_lifetimes, bounds, predicate_span, in_where_clause) = match where_predicate {

bound_count += bound_spans.len(); let drop_predicate = bound_spans.len() == bounds.len(); <del> if drop_predicate { dropped_predicate_count += 1; </del> <ins> if drop_predicate && in_where_clause { dropped_where_predicate_count += 1; </ins> } if drop_predicate {

} else if predicate_span.from_expansion() { // Don't try to extend the span if it comes from a macro expansion. where_lint_spans.push(predicate_span); <del> } else if i + 1 < num_predicates { </del> <ins> } else if i + 1 < num_where_predicates { </ins> // If all the bounds on a predicate were inferable and there are // further predicates, we want to eat the trailing comma. let next_predicate_span = hir_generics.predicates[i + 1].span();

} } <del> // If all predicates are inferable, drop the entire clause </del> <ins> // If all predicates in where clause are inferable, drop the entire clause </ins> // (including the `where`) <del> if hir_generics.has_where_clause_predicates && dropped_predicate_count == num_predicates </del> <ins> if hir_generics.has_where_clause_predicates && dropped_where_predicate_count == num_where_predicates </ins> { let where_span = hir_generics.where_clause_span; // Extend the where clause back to the closing `>` of the

yoo: &'a U } <ins> // https://github.com/rust-lang/rust/issues/105150 struct InferredWhereBoundWithInlineBound<'a, T: ?Sized> { data: &'a T, } </ins> fn main() {}

yoo: &'a U } <ins> // https://github.com/rust-lang/rust/issues/105150 struct InferredWhereBoundWithInlineBound<'a, T: ?Sized> //~^ ERROR outlives requirements can be inferred where T: 'a, { data: &'a T, } </ins> fn main() {}

|         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: outlives requirements can be inferred <ins> --> $DIR/edition-lint-infer-outlives.rs:805:56 | LL |   struct InferredWhereBoundWithInlineBound<'a, T: ?Sized> |  ________________________________________________________^ LL | | LL | |     where T: 'a, | |________________^ help: remove this bound error: outlives requirements can be inferred </ins> --> $DIR/edition-lint-infer-outlives.rs:26:31 | LL |     struct TeeOutlivesAy<'a, T: 'a> {

LL |     union BeeWhereOutlivesAyTeeWhereDebug<'a, 'b, T> where 'b: 'a, T: Debug { |                                                            ^^^^^^^^ help: remove this bound <del> error: aborting due to 153 previous errors </del> <ins> error: aborting due to 154 previous errors </ins>