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:
parent
0a5b998c57
commit
a8d869e1d1
7 changed files with 119 additions and 70 deletions
|
@ -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:,
|
||||
{}
|
||||
}
|
|
@ -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;
|
Loading…
Add table
Add a link
Reference in a new issue