Rollup merge of #98911 - notriddle:notriddle/rustdoc-string-impl, r=GuillaumeGomez
rustdoc: filter '_ lifetimes from ty::Generics Fixes a weirdly-rendered section of the std::string::String docs. Before:  After: 
This commit is contained in:
commit
d87bf24925
src
librustdoc/clean
test/rustdoc
@ -629,6 +629,7 @@ fn clean_ty_generics<'tcx>(
|
|||||||
.params
|
.params
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|param| match param.kind {
|
.filter_map(|param| match param.kind {
|
||||||
|
ty::GenericParamDefKind::Lifetime if param.name == kw::UnderscoreLifetime => None,
|
||||||
ty::GenericParamDefKind::Lifetime => Some(param.clean(cx)),
|
ty::GenericParamDefKind::Lifetime => Some(param.clean(cx)),
|
||||||
ty::GenericParamDefKind::Type { synthetic, .. } => {
|
ty::GenericParamDefKind::Type { synthetic, .. } => {
|
||||||
if param.name == kw::SelfUpper {
|
if param.name == kw::SelfUpper {
|
||||||
|
@ -7,3 +7,11 @@ where
|
|||||||
{
|
{
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub struct Extra;
|
||||||
|
|
||||||
|
pub trait MyTrait<T> {
|
||||||
|
fn run() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl MyTrait<&Extra> for Extra {}
|
||||||
|
@ -11,3 +11,7 @@ extern crate issue_98697_reexport_with_anonymous_lifetime;
|
|||||||
// @has issue_98697/fn.repro.html '//pre[@class="rust fn"]/code' 'fn repro<F>() where F: Fn(&str)'
|
// @has issue_98697/fn.repro.html '//pre[@class="rust fn"]/code' 'fn repro<F>() where F: Fn(&str)'
|
||||||
// @!has issue_98697/fn.repro.html '//pre[@class="rust fn"]/code' 'for<'
|
// @!has issue_98697/fn.repro.html '//pre[@class="rust fn"]/code' 'for<'
|
||||||
pub use issue_98697_reexport_with_anonymous_lifetime::repro;
|
pub use issue_98697_reexport_with_anonymous_lifetime::repro;
|
||||||
|
|
||||||
|
// @has issue_98697/struct.Extra.html '//div[@id="trait-implementations-list"]//h3[@class="code-header in-band"]' 'impl MyTrait<&Extra> for Extra'
|
||||||
|
// @!has issue_98697/struct.Extra.html '//div[@id="trait-implementations-list"]//h3[@class="code-header in-band"]' 'impl<'
|
||||||
|
pub use issue_98697_reexport_with_anonymous_lifetime::Extra;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user