rustdoc: cross-crate re-exports: correctly render late-bound params in source order even if early-bound params are present

This commit is contained in:
León Orell Valerian Liehr 2024-02-13 11:52:27 +01:00
parent 0a5b998c57
commit a8d869e1d1
No known key found for this signature in database
GPG key ID: D17A07215F68E713
7 changed files with 119 additions and 70 deletions

View file

@ -0,0 +1,17 @@
// Here, `'a` and `'c` are late-bound and `'b`, `'d`, `T` and `N` are early-bound.
pub fn f<'a, 'b, 'c, 'd, T, const N: usize>(_: impl Copy)
where
'b:,
'd:,
{}
pub struct Ty;
impl Ty {
pub fn f<'a, 'b, 'c, 'd, T, const N: usize>(_: impl Copy)
where
'b:,
'd:,
{}
}

View file

@ -0,0 +1,17 @@
// Check that we correctly render late-bound lifetime params in source order
// even if early-bound generic params are present.
//
// For context, at the time of writing early- and late-bound params are stored
// separately in rustc and therefore rustdoc needs to manually merge them.
#![crate_name = "usr"]
// aux-crate:dep=early-late-bound-lifetime-params.rs
// edition:2021
// @has usr/fn.f.html
// @has - '//pre[@class="rust item-decl"]' "fn f<'a, 'b, 'c, 'd, T, const N: usize>(_: impl Copy)"
pub use dep::f;
// @has usr/struct.Ty.html
// @has - '//*[@id="method.f"]' "fn f<'a, 'b, 'c, 'd, T, const N: usize>(_: impl Copy)"
pub use dep::Ty;