mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
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:
parent
9cdab67f6e
commit
2d9755fa21
@ -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);
|
||||
}
|
||||
|
@ -38,3 +38,7 @@ extern crate assoc_item_trait_bounds as aux;
|
||||
// F: FnOnce(u32) -> String, \
|
||||
// Self::Out2<()>: Protocol<u8, Q0 = Self::Item, Q1 = ()>"
|
||||
pub use aux::Main;
|
||||
|
||||
// @has main/trait.Aid.html
|
||||
// @has - '//*[@id="associatedtype.Result"]' "type Result<'inter: 'src>"
|
||||
pub use aux::Aid;
|
||||
|
@ -42,5 +42,5 @@ pub trait Helper {
|
||||
}
|
||||
|
||||
pub trait Aid<'src> {
|
||||
type Result<'inter>;
|
||||
type Result<'inter: 'src>;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user