about summary refs log tree commit diff
path: root/src/librustdoc/html
AgeCommit message (Collapse)AuthorLines
2023-12-12Clean up CodeBlocks::next codeGuillaume Gomez-38/+29
2023-12-11rustdoc-search: clean up parserMichael Howell-7/+2
The `c === "="` was redundant when `isSeparatorCharacter` already checks that. The function `isStopCharacter` and `isEndCharacter` functions did exactly the same thing and have synonymous names. There doesn't seem much point in having both.
2023-12-10rustdoc-search: fix fast path unboxing bindingsMichael Howell-1/+1
2023-12-10rustdoc-search: do not treat associated type names as typesMichael Howell-13/+20
Before: http://notriddle.com/rustdoc-html-demo-6/tor-before/tor_config/ After: http://notriddle.com/rustdoc-html-demo-6/tor-after/tor_config/ Profile: http://notriddle.com/rustdoc-html-demo-6/tor-profile/ As a bit of background information: in type-based queries, a type name that does not exist gets treated as a generic type variable. This causes a counterintuitive behavior in the `tor_config` crate, which has a trait with an associated type variable called `T`. This isn't a searchable concrete type, but its name still gets stored in the typeNameIdMap, as a convenient way to intern its name.
2023-12-10remove redundant importssurechen-1/+0
detects redundant imports that can be eliminated. for #117772 : In order to facilitate review and modification, split the checking code and removing redundant imports code into two PR.
2023-12-08Rollup merge of #118722 - notriddle:notriddle/dom-opt-3, r=GuillaumeGomezMatthias Krüger-19/+6
rustdoc: remove unused parameter `reversed` from onEach(Lazy) This feature was added in edec5807ac5ba90cbc0c61a5ec7b80f29e1eea33 to support JavaScript-based toggles that were later replaced with HTML `<details>`.
2023-12-08Rollup merge of #118677 - GuillaumeGomez:doc_cfg-display, r=notriddleMatthias Krüger-9/+12
[rustdoc] Fix display of features Fixes https://github.com/rust-lang/rust/issues/118615. It now looks like this: ![image](https://github.com/rust-lang/rust/assets/3050060/6e77204e-0706-44a3-89ae-2dbd1934ebbc) We can't use flex without breaking the flow, meaning we can't vertically align items as we want. Because of that, the `min-height` was problematic as it rendered weirdly and therefore needed to be removed. r? `@notriddle`
2023-12-07rustdoc: remove unused parameter `reversed` from onEach(Lazy)Michael Howell-19/+6
This feature was added in edec5807ac5ba90cbc0c61a5ec7b80f29e1eea33 to support JavaScript-based toggles that were later replaced with HTML `<details>`.
2023-12-07Fix display of features in rustdocGuillaume Gomez-9/+12
2023-12-05Generate section headings all from one placeGuillaume Gomez-64/+68
2023-12-05Make all headings display the same by creating an anchor right beside themGuillaume Gomez-1/+1
2023-12-05Rollup merge of #118594 - hdost:patch-1, r=fmeaseMatthias Krüger-1/+1
Remove mention of rust to make the error message generic. The deprecation notice is used when in crates as well. This applies to versions Rust or Crates. Relates #118148
2023-12-05Make headings anchor hidden by default and show on hoverGuillaume Gomez-3/+19
2023-12-05Allow links in doc blocks headingsGuillaume Gomez-1/+7
2023-12-05Rework doc blocks headings by not turning them into links anymore and ↵Guillaume Gomez-17/+47
putting an anchor to their left side
2023-12-05Remove mention of rust to make the error message generic.Harold Dost-1/+1
The deprecation notice is used when in crates as well. This applies to versions Rust or Crates. Fixes #118148 Signed-off-by: Harold Dost <h.dost@criteo.com>
2023-12-04Rollup merge of #118600 - GuillaumeGomez:fields-heading, r=notriddleGuillaume Gomez-1/+8
[rustdoc] Don't generate the "Fields" heading if there is no field displayed Fixes https://github.com/rust-lang/rust/issues/118195. If no field is displayed, we should not generate the `Fields` heading in enum struct variants. r? ``@notriddle``
2023-12-04Rollup merge of #118508 - notriddle:notriddle/fmt-newline, r=GuillaumeGomezGuillaume Gomez-8/+50
rustdoc: do not escape quotes in body text Escaping quote marks is only needed in attributes, not text. ```console $ du -hs doc-old/ doc-new/ 670M doc-old/ 669M doc-new/ ```
2023-12-04Don't generate the "Fields" heading if there is no field displayedGuillaume Gomez-1/+8
2023-12-01rustdoc: do not escape quotes in body textMichael Howell-8/+50
Escaping quote marks is only needed in attributes, not text. ```console $ du -hs doc-old/ doc-new/ 670M doc-old/ 669M doc-new/ ```
2023-12-01Add highlighting for comments in items declarationGuillaume Gomez-8/+14
2023-12-01Rollup merge of #118483 - notriddle:notriddle/fmt-newline, r=GuillaumeGomezTakayuki Maeda-16/+8
rustdoc: `div.where` instead of fmt-newline class This is about equally readable, a lot more terse, and stops special-casing functions and methods. ```console $ du -hs doc-old/ doc-new/ 671M doc-old/ 670M doc-new/ ```
2023-11-30rustdoc: `div.where` instead of fmt-newline classMichael Howell-16/+8
This is about equally readable, a lot more terse, and stops special-casing functions and methods. ```console $ du -hs doc-old/ doc-new/ 671M doc-old/ 670M doc-new/ ```
2023-11-30Rollup merge of #118458 - notriddle:notriddle/small-section-header, ↵Matthias Krüger-16/+16
r=GuillaumeGomez rustdoc: remove small from `small-section-header` There's no such thing as a big section header, so I don't know why the name was used.
2023-11-29rustdoc: remove small from `small-section-header`Michael Howell-16/+16
There's no such thing as a big section header, so I don't know why the name was used.
2023-11-29rustdoc-search: replace TAB/NL/LF with SP firstMichael Howell-10/+6
This way, most of the parsing code doesn't need to be designed to handle it, since they should always be treated exactly the same anyhow.
2023-11-29rustdoc-search: removed dead parser codeMichael Howell-2/+0
This is already covered by the normal unexpected char path.
2023-11-29rustdoc-search: allow `:: ` and ` ::`Michael Howell-8/+5
This restriction made sense back when spaces separated function parameters, but now that they separate path components, there's no real ambiguity any more. Additionally, the Rust language allows it.
2023-11-29Always display stability version even if it's the same as the containing itemGuillaume Gomez-54/+14
2023-11-29rustdoc: Move `AssocItemRender` and `RenderMode` to `html::render`.Alona Enraght-Moony-5/+21
They're only used for HTML, so it makes more sense for them to live their.
2023-11-27Auto merge of #118353 - matthiaskrgr:rollup-sf1booi, r=matthiaskrgrbors-2/+1
Rollup of 3 pull requests Successful merges: - #118322 (skip {tidy,compiletest,rustdoc-gui} based tests for `DocTests::Only`) - #118325 (Fix Rustdoc search docs link) - #118338 (Backticks fixes) r? `@ghost` `@rustbot` modify labels: rollup
2023-11-27Rollup merge of #118325 - clubby789:rustdoc-search-link, r=fmeaseMatthias Krüger-2/+1
Fix Rustdoc search docs link This link has been outdated since #112725 moved the search docs to their own page
2023-11-27Auto merge of #118321 - WaffleLapkin:unspace-fn-pointer-fake-variadic, ↵bors-1/+1
r=notriddle rustdoc: Remove space from fake-variadic fn ptr impls before: `for fn (T₁, T₂, …, Tₙ) -> Ret` after: `for fn(T₁, T₂, …, Tₙ) -> Ret` I don't think we usually have spaces there, so it looks weird. cc `@notriddle` since you added the space in https://github.com/rust-lang/rust/pull/98180 (or rather, added the feature with a space included).
2023-11-26Fix Rustdoc search docs linkclubby789-2/+1
2023-11-26rustdoc: Remove space from fake-variadic fn ptr implsMaybe Waffle-1/+1
before: `for fn (T₁, T₂, …, Tₙ) -> Ret` after: `for fn(T₁, T₂, …, Tₙ) -> Ret`
2023-11-26Rollup merge of #118296 - notriddle:notriddle/main-dom, r=GuillaumeGomezGuillaume Gomez-21/+11
rustdoc: replace `elemIsInParent` with `Node.contains` According to [MDN], this function is compatible with: * Chrome 16 and Edge 12 * Firefox 9 * Safari 1.1 and iOS Safari 1 These browsers are well within our [support matrix], which requires compatibility with Chrome 118, Firefox 115, Safari 17, and Edge 119. [MDN]: https://developer.mozilla.org/en-US/docs/Web/API/Node/contains#browser_compatibility [support matrix]: https://browsersl.ist/#q=last+2+Chrome+versions%2C+last+1+Firefox+version%2C+Firefox+ESR%2C+last+1+Safari+version%2C+last+1+iOS+version%2C+last+1+Edge+version%2C+last+1+UCAndroid+version
2023-11-26rustc: `hir().local_def_id_to_hir_id()` -> `tcx.local_def_id_to_hir_id()` ↵Vadim Petrochenkov-2/+2
cleanup
2023-11-25Rollup merge of #118289 - compiler-errors:is_some_and_rustdoc, r=fmeaseMichael Goulet-3/+2
`is_{some,ok}_and` for rustdoc slightly more fluent-reading code r? fmease
2023-11-25rustdoc: replace `elemIsInParent` with `Node.contains`Michael Howell-21/+11
According to [MDN], this function is compatible with: * Chrome 16 and Edge 12 * Firefox 9 * Safari 1.1 and iOS Safari 1 These browsers are well within our [support matrix], which requires compatibility with Chrome 118, Firefox 115, Safari 17, and Edge 119. [MDN]: https://developer.mozilla.org/en-US/docs/Web/API/Node/contains#browser_compatibility [support matrix]: https://browsersl.ist/#q=last+2+Chrome+versions%2C+last+1+Firefox+version%2C+Firefox+ESR%2C+last+1+Safari+version%2C+last+1+iOS+version%2C+last+1+Edge+version%2C+last+1+UCAndroid+version
2023-11-25rustdoc-search: clean up some DOM codeMichael Howell-11/+5
2023-11-25is_{some,ok}_and for rustdocMichael Goulet-3/+2
2023-11-25Rollup merge of #118253 - dtolnay:issomeand, r=compiler-errorsLeón Orell Valerian Liehr-2/+4
Replace `option.map(cond) == Some(true)` with `option.is_some_and(cond)` Requested by `@fmease` in https://github.com/rust-lang/rust/pull/118226#pullrequestreview-1747432292. There is also a much larger number of `option.map_or(false, cond)` that can be changed separately if someone wants. r? fmease
2023-11-24rustdoc-search: avoid infinite where clause unboxMichael Howell-8/+24
Fixes #118242
2023-11-24Replace `option.map(cond) == Some(true)` with `option.is_some_and(cond)`David Tolnay-2/+4
2023-11-23Sort unstable items last in rustdoc, instead of firstDavid Tolnay-2/+2
2023-11-23Don't print "private fields" on empty tuple structsKyuuhachi-5/+9
Test for presence rather than absence Remove redundant tests Issues in those parts will likely be caught by other parts of the test suite.
2023-11-22Don't merge cfg and doc(cfg) attributes for re-exportsGuillaume Gomez-11/+2
2023-11-21rustdoc-search: make primitives and keywords less specialMichael Howell-24/+12
The search sorting code already sorts by item type discriminant, putting things with smaller discriminants first. There was also a special case for sorting keywords and primitives earlier, and this commit removes it by giving them lower discriminants. The sorting code has another criteria where items with descriptions appear earlier than items without, and that criteria has higher priority than the item type. This shouldn't matter, though, because primitives and keywords normally only appear in the standard library, and it always gives them descriptions.
2023-11-21rustdoc-search: clean up `checkPath`Michael Howell-13/+3
This computes the same result with less code by computing many of the old checks at once: * It won't enter the loop if clength > length, because then the result of length - clength will be negative and the loop conditional will fail. * i + clength will never be greater than length, because it starts out as i = length - clength, implying that i + clength equals length, and it only goes down from there. * The aborted variable is replaced with control flow.
2023-11-19rustdoc-search: add support for associated typesMichael Howell-114/+683