about summary refs log tree commit diff
path: root/src/librustdoc/html/format.rs
AgeCommit message (Collapse)AuthorLines
2023-07-26rustdoc: fix cross-crate impl-SizedLeón Orell Valerian Liehr-11/+24
2023-07-22fix doc links on `extern crate` itemsLukas Markeffsky-1/+9
2023-07-12Re-format let-else per rustfmt updateMark Rousskov-3/+4
2023-06-28rustdoc: Reduce internal function visibility.Alona Enraght-Moony-1/+1
As suggested in https://github.com/rust-lang/rust/pull/112113/files/1862fcb1df05b116443ad3b27028616a180ffadb#r1211200570.
2023-06-24rustdoc: get rid of extra line when line-wrapping fn decls with empty arg listLeón Orell Valerian Liehr-1/+1
2023-06-22Fix indentation for where clause in rustdoc pagesGuillaume Gomez-5/+12
2023-05-30rustdoc: simplify `clean` by removing `FnRetTy`Michael Howell-21/+18
The default fn ret ty is always unit. Just use that. Looking back at the time when `FnRetTy` (then called `FunctionRetTy`) was first added to rustdoc, it seems to originally be there because `-> !` was a special form: the never type didn't exist back then. https://github.com/rust-lang/rust/commit/eb01b17b06eb35542bb80ff7456043b0ed5572ba#diff-384affc1b4190940f114f3fcebbf969e7e18657a71ef9001da6b223a036687d9L921-L924
2023-05-04IAT: Rustdoc integrationLeón Orell Valerian Liehr-11/+35
2023-05-02Make tools happyMichael Goulet-0/+1
2023-04-29fix rustdoc and core testDeadbeef-1/+1
2023-04-10Fix typos in librustdocDaniPopes-2/+2
2023-04-08Auto merge of #109925 - notriddle:notriddle/item-union, r=GuillaumeGomezbors-4/+0
rustdoc: migrate item_union to an Askama template
2023-04-05rustdoc: migrate `item_union` to an Askama templateMichael Howell-4/+0
2023-04-04rustdoc: escape GAT args in more casesLeón Orell Valerian Liehr-16/+15
2023-03-28rustdoc + rustdoc-json support for non_lifetime_bindersMichael Goulet-2/+2
2023-03-20Rollup merge of #109269 - klensy:rdoc-s, r=notriddleMatthias Krüger-1/+1
rustdoc: cleanup some intermediate allocs First commit self contained, second one use `display_fn` for `extra_info_tags`
2023-03-17rustdoc: reduce allocations in `visibility_to_src_with_space`Michael Howell-7/+7
2023-03-16clean up few allocklensy-1/+1
2023-03-15rustdoc: remove `std::` from primitive intra-doc link tooltipsMichael Howell-0/+6
2023-03-11rustdoc: reduce allocs in FnDecl::inner_full_printJacob Hoffman-Andrews-65/+71
Instead of maintaining parallel buffers for both HTML and non-HTML output, follow the idiom from the rest of format.rs that f.alternate() == true means textual output. Also, add an argument to control line wrapping explicitly. This allows the caller to render once with textual output and no line wrapping, to decide whether line wrapping should be applied in the final HTML output. Also, remove some format! and " ".repeat calls, and remove a dependency on calling `String::replace` to switch from newlines to spaces. This coincidentally fixes some minor bugs where the old code was undercounting the number of characters for a declaration in text mode.
2023-03-02rustc_middle: Remove trait `DefIdTree`Vadim Petrochenkov-1/+0
This trait was a way to generalize over both `TyCtxt` and `Resolver`, but now `Resolver` has access to `TyCtxt`, so this trait is no longer necessary.
2023-02-22rustdoc: reduce allocations when generating tooltipsMichael Howell-6/+13
An attempt to reduce the perf regression in https://github.com/rust-lang/rust/pull/108052#issuecomment-1430631861
2023-02-22diagnostics: if AssocFn has self argument, describe as methodMichael Howell-1/+1
Discussed in https://rust-lang.zulipchat.com/#narrow/stream/147480-t-compiler.2Fwg-diagnostics/topic/.22associated.20function.22.20vs.20.22method.22/near/329265515 This commit also changes the tooltips on rustdoc intra-doc links targeting methods.
2023-02-16Rollup merge of #108099 - matthiaskrgr:str_to_char, r=GuillaumeGomezMatthias Krüger-3/+3
use chars instead of strings where applicable
2023-02-15use chars instead of strings where applicableMatthias Krüger-3/+3
2023-02-15Rollup merge of #108076 - GuillaumeGomez:more-let-chain, r=notriddleMatthias Krüger-5/+3
rustdoc: Use more let chain Got the idea after yesterday's review. r? `@notriddle`
2023-02-15Use more let chainGuillaume Gomez-5/+3
2023-02-13rustdoc: add more tooltips to intra-doc linksMichael Howell-0/+16
This commit makes intra-doc link tooltips consistent with generated links in function signatures and item tables, with the format `itemtype foo::bar::baz`. This way, you can tell if a link points at a trait or a type (for example) by mousing over it. See also fce944d4e79b3a87ddf511206724edf33acfd704
2023-02-07rustdoc: use a newline instead of `<br>` to format code headersMichael Howell-17/+14
Since these elements now use `white-space: pre-wrap` since 784665d4ce59c5239791f1f96fa2137e47ca1817, it's fine to use newlines for formatting, which is smaller and a bit less complicated.
2023-02-04rustdoc: trait bound formattingRoland Strasser-2/+10
rustdoc: fix item-spacer rustdoc: use proper comment style rustdoc: change formatting where clauses for traits rustdoc: remove semicolon from provided methods update provided methods formatting
2023-02-03Replace nbsp in all rustdoc code blocksMichael Howell-10/+10
Co-Authored-By: David Tolnay <dtolnay@gmail.com>
2023-01-23rustdoc: rearrange HTML in primitive reference linksMichael Howell-8/+2
This patch avoids hard-to-click single character links by making the generic part of the link: Before: <a href="#">&</a>T After: <a href="#">&T</a>
2023-01-15rustdoc: simplify some & ref erencesMatthias Krüger-1/+1
2023-01-13fmt_type: don't alloc const String, use &str insteadklensy-1/+1
2023-01-13generate_macro_def_id_path: don't eagerly stringify Symbolsklensy-7/+12
2022-12-22Fix ICEkadmin-4/+4
Left a todo awhile ago (I think), so fill it in to print a const for `Term`s.
2022-11-07rustdoc: use javascript to layout notable traits popupsMichael Howell-4/+0
Fixes #102576
2022-11-04rustdoc: render unnamed arguments as underscores in cross-crate functions & ↵León Orell Valerian Liehr-7/+4
function pointers for consistency with the way we display local definitions (cleaned from HIR, not from rustc_middle).
2022-11-03Remove rustdoc clean::Visibility typeGuillaume Gomez-77/+74
2022-10-29rustdoc: Split effective visibilities from rustc from similar data built by ↵Vadim Petrochenkov-1/+1
rustdoc for external def-ids
2022-10-26privacy: Rename "accessibility levels" to "effective visibilities"Vadim Petrochenkov-1/+1
And a couple of other naming tweaks Related to https://github.com/rust-lang/rust/issues/48054
2022-10-14more dupe word typosRageking8-1/+1
2022-10-05rustdoc: render more cross-crate hrtbs properlyLeón Orell Valerian Liehr-1/+2
2022-09-30rustdoc: remove orphaned link on array bracketMichael Howell-8/+18
This is 682889fb06591c4245422b73b005c5d8ae2d0cad, but for arrays instead. For non-generics, this retains links to the array page, but instead of trying to link it all, it only links the length part, which distinguishes arrays from slices. For generics, the entire thing becomes a link, just like slices.
2022-09-21Add missing space between notable trait tooltip and where clauseUrgau-1/+1
2022-09-11Avoid `Iterator::last`KaDiWa-2/+2
2022-09-01Rollup merge of #101245 - GuillaumeGomez:remove-unneeded-where-whitespace, ↵Matthias Krüger-9/+4
r=notriddle Remove unneeded where whitespace It fixes these two bugs: ![Screenshot from 2022-08-31 18-14-40](https://user-images.githubusercontent.com/3050060/187727950-94657419-abfa-454c-9d27-004280fbcb45.png) ![Screenshot from 2022-08-31 18-14-49](https://user-images.githubusercontent.com/3050060/187727956-21d1b39d-62d7-4e7b-8f6f-631ceda67a19.png) It's a relic from a very old time (this commit: https://github.com/rust-lang/rust/commit/bfd01b7f40ae2cbfe9acbc1d10e79ffe16870df8). You can test the result [here](https://rustdoc.crud.net/imperio/remove-unneeded-where-whitespace/lib2/struct.WhereWhitespace.html). cc `````````@jsha````````` r? `````````@notriddle`````````
2022-08-31Remove unneeded extra whitespace before where clauseGuillaume Gomez-9/+4
2022-08-30rustdoc: Resugar async fn return type in `clean`, not `html`Nixon Enraght-Moony-13/+4
This way it also happens for json output. Fixes #101199
2022-08-16rustdoc: factor Type::QPath out into its own boxMichael Howell-1/+6
This reduces the size of Type.