diff options
| author | León Orell Valerian Liehr <liehr.exchange@gmx.net> | 2022-11-02 15:17:34 +0100 |
|---|---|---|
| committer | León Orell Valerian Liehr <liehr.exchange@gmx.net> | 2022-11-04 19:34:37 +0100 |
| commit | 2d9755fa21bb2184e522a48fa6f3d18f0e1bf62f (patch) | |
| tree | f4df5605b5d0fa34b019894e4f225b05018e984a /src/librustdoc | |
| parent | 9cdab67f6e3f249e677abf3580637fe42324a961 (diff) | |
rustdoc: move cross-crate lifetime/outlives bounds on GAT params from where-clause to param declaration site
I've overlooked this in #103190.
Diffstat (limited to 'src/librustdoc')
| -rw-r--r-- | src/librustdoc/clean/mod.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 4a3337ffa1f..eba2d23bdaa 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -1303,7 +1303,16 @@ pub(crate) fn clean_middle_assoc_item<'tcx>( .. }) = generics.params.iter_mut().find(|param| ¶m.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| ¶m.name == arg) { + param_bounds.extend(bounds.drain(..).map(|bound| match bound { + GenericBound::Outlives(lifetime) => lifetime, + _ => unreachable!(), + })); } else { where_predicates.push(pred); } |
