diff options
| author | bors <bors@rust-lang.org> | 2023-12-01 06:32:25 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-12-01 06:32:25 +0000 |
| commit | 9bf30ebdfa50db6286d9400615c2bcb324c1a587 (patch) | |
| tree | 287c315a62c74231a4b1c551faadc854179c39aa /src/librustdoc/html | |
| parent | a1c65db95cf79c23dceaf1b59038819f115bdf11 (diff) | |
| parent | 65026fae88d1702832708d2597872a3f92b5d5dc (diff) | |
| download | rust-9bf30ebdfa50db6286d9400615c2bcb324c1a587.tar.gz rust-9bf30ebdfa50db6286d9400615c2bcb324c1a587.zip | |
Auto merge of #118493 - TaKO8Ki:rollup-jfkdbyo, r=TaKO8Ki
Rollup of 3 pull requests Successful merges: - #118483 (rustdoc: `div.where` instead of fmt-newline class) - #118486 (generic_const_exprs: suggest to add the feature, not use it) - #118489 (Wesley is on vacation) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src/librustdoc/html')
| -rw-r--r-- | src/librustdoc/html/format.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/html/render/mod.rs | 15 | ||||
| -rw-r--r-- | src/librustdoc/html/static/css/rustdoc.css | 7 |
3 files changed, 8 insertions, 16 deletions
diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index bed8f6ffef5..a9c0ab557cb 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -367,7 +367,7 @@ pub(crate) fn print_where_clause<'a, 'tcx: 'a>( if ending == Ending::Newline { let mut clause = " ".repeat(indent.saturating_sub(1)); - write!(clause, "<span class=\"where fmt-newline\">where{where_preds},</span>")?; + write!(clause, "<div class=\"where\">where{where_preds},</div>")?; clause } else { // insert a newline after a single space but before multiple spaces at the start diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index 51ec33bd832..e076c1b92e6 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -1441,15 +1441,10 @@ fn notable_traits_decl(ty: &clean::Type, cx: &Context<'_>) -> (String, String) { ); } - //use the "where" class here to make it small - write!( - &mut out, - "<span class=\"where fmt-newline\">{}</span>", - impl_.print(false, cx) - ); + write!(&mut out, "<div class=\"where\">{}</div>", impl_.print(false, cx)); for it in &impl_.items { if let clean::AssocTypeItem(ref tydef, ref _bounds) = *it.kind { - out.push_str("<span class=\"where fmt-newline\"> "); + out.push_str("<div class=\"where\"> "); let empty_set = FxHashSet::default(); let src_link = AssocItemLink::GotoSource(trait_did.into(), &empty_set); assoc_type( @@ -1462,7 +1457,7 @@ fn notable_traits_decl(ty: &clean::Type, cx: &Context<'_>) -> (String, String) { 0, cx, ); - out.push_str(";</span>"); + out.push_str(";</div>"); } } } @@ -1948,7 +1943,7 @@ pub(crate) fn render_impl_summary( if show_def_docs { for it in &inner_impl.items { if let clean::AssocTypeItem(ref tydef, ref _bounds) = *it.kind { - w.write_str("<span class=\"where fmt-newline\"> "); + w.write_str("<div class=\"where\"> "); assoc_type( w, it, @@ -1959,7 +1954,7 @@ pub(crate) fn render_impl_summary( 0, cx, ); - w.write_str(";</span>"); + w.write_str(";</div>"); } } } diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index d8250c273b0..b898eb5d381 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -703,11 +703,8 @@ pre, .rustdoc.src .example-wrap { background: var(--table-alt-row-background-color); } -/* Shift "where ..." part of method or fn definition down a line */ -.method .where, -.fn .where, -.where.fmt-newline { - display: block; +/* "where ..." clauses with block display are also smaller */ +div.where { white-space: pre-wrap; font-size: 0.875rem; } |
