rustdoc: move cross-crate lifetime/outlives bounds on GAT params from where-clause to param declaration site

I've overlooked this in #103190.
This commit is contained in:
León Orell Valerian Liehr 2022-11-02 15:17:34 +01:00
parent 9cdab67f6e
commit 2d9755fa21
3 changed files with 15 additions and 2 deletions

View file

@ -1303,7 +1303,16 @@ pub(crate) fn clean_middle_assoc_item<'tcx>(
..
}) = generics.params.iter_mut().find(|param| &param.name == arg)
{
param_bounds.extend(mem::take(bounds));
param_bounds.append(bounds);
} else if let WherePredicate::RegionPredicate { lifetime: Lifetime(arg), bounds } = &mut pred
&& let Some(GenericParamDef {
kind: GenericParamDefKind::Lifetime { outlives: param_bounds },
..
}) = generics.params.iter_mut().find(|param| &param.name == arg) {
param_bounds.extend(bounds.drain(..).map(|bound| match bound {
GenericBound::Outlives(lifetime) => lifetime,
_ => unreachable!(),
}));
} else {
where_predicates.push(pred);
}