about summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2023-12-12Rollup merge of #118886 - GuillaumeGomez:clean-up-search-vars, r=notriddleJubilee-13/+7
Clean up variables in `search.js` While reviewing https://github.com/rust-lang/rust/pull/118402, I saw a few small clean ups that were needed, mostly about variables creation. r? ```@notriddle```
2023-12-12Rollup merge of #118885 - matthiaskrgr:compl_2023, r=compiler-errorsJubilee-1/+2
clippy::complexity fixes filter_map_identity needless_bool search_is_some unit_arg map_identity needless_question_mark derivable_impls
2023-12-12Rollup merge of #118872 - GuillaumeGomez:codeblock-attr-lint, r=notriddleJubilee-43/+56
Add rustX check to codeblock attributes lint We discovered this issue [here](https://github.com/rust-lang/rust/pull/118802#discussion_r1421815943). I assume that the issue will be present in other places outside of the compiler so it's worth adding a check for it. First commit is just a small cleanup about variables creation which was a bit strange (at least more than necessary). r? ```@notriddle```
2023-12-12more clippy::complexity fixesMatthias Krüger-4/+4
redundant_guards redundant_slicing filter_next needless_borrowed_reference useless_format
2023-12-12Clean up variables in `search.js`Guillaume Gomez-13/+7
2023-12-12clippy::complexity fixesMatthias Krüger-1/+2
filter_map_identity needless_bool search_is_some unit_arg map_identity needless_question_mark derivable_impls
2023-12-12Follow guidelines for lint suggestionsGuillaume Gomez-9/+21
2023-12-12Add `rustX` check to codeblock attributes lintGuillaume Gomez-0/+10
2023-12-12Move some methods from `tcx.hir()` to `tcx`zetanumbers-9/+8
Renamings: - find -> opt_hir_node - get -> hir_node - find_by_def_id -> opt_hir_node_by_def_id - get_by_def_id -> hir_node_by_def_id Fix rebase changes using removed methods Use `tcx.hir_node_by_def_id()` whenever possible in compiler Fix clippy errors Fix compiler Apply suggestions from code review Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com> Add FIXME for `tcx.hir()` returned type about its removal Simplify with with `tcx.hir_node_by_def_id`
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-11Rollup merge of #118812 - notriddle:notriddle/assoc-name-intern, ↵Guillaume Gomez-14/+21
r=GuillaumeGomez rustdoc-search: do not treat associated type names as types [Before](http://notriddle.com/rustdoc-html-demo-6/tor-before/tor_config/list_builder/trait.DirectDefaultEmptyListBuilderAccessors.html?search=DirectDefaultEmptyListBuilderAccessors%3CT%3DT%3E%20-%3E%20Vec%3CT%3E#associatedtype.T) [After](http://notriddle.com/rustdoc-html-demo-6/tor-after/tor_config/list_builder/trait.DirectDefaultEmptyListBuilderAccessors.html?search=DirectDefaultEmptyListBuilderAccessors%3CT%3DT%3E%20-%3E%20Vec%3CT%3E#associatedtype.T) [Profile](http://notriddle.com/rustdoc-html-demo-6/tor-profile/index.html) 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. (The second commit is a mostly unrelated bugfix.)
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-11Add spacing information to delimiters.Nicholas Nethercote-3/+3
This is an extension of the previous commit. It means the output of something like this: ``` stringify!(let a: Vec<u32> = vec![];) ``` goes from this: ``` let a: Vec<u32> = vec![] ; ``` With this PR, it now produces this string: ``` let a: Vec<u32> = vec![]; ```
2023-12-10remove redundant importssurechen-11/+6
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-06Auto merge of #118605 - fee1-dead-contrib:rm-rustc_host, r=compiler-errorsbors-6/+7
Remove `#[rustc_host]`, use internal desugaring Also removed a way for users to explicitly specify the host param since that isn't particularly useful. This should eliminate any pain with encoding attributes across crates and etc. r? `@compiler-errors`
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-05Remove `#[rustc_host]`, use internal desugaringDeadbeef-6/+7
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-29Rollup merge of #118428 - aDotInTheVoid:doc-cleanup, r=GuillaumeGomezMatthias Krüger-20/+21
rustdoc: Move `AssocItemRender` and `RenderMode` to `html::render`. They're only used for HTML, so it makes more sense for them to live their.
2023-11-29Rollup merge of #118157 - Nadrieril:never_pat-feature-gate, r=compiler-errorsMatthias Krüger-1/+2
Add `never_patterns` feature gate This PR adds the feature gate and most basic parsing for the experimental `never_patterns` feature. See the tracking issue (https://github.com/rust-lang/rust/issues/118155) for details on the experiment. `@scottmcm` has agreed to be my lang-team liaison for this experiment.
2023-11-29Always display stability version even if it's the same as the containing itemGuillaume Gomez-61/+14
2023-11-29Add `never_patterns` feature gateNadrieril-1/+2
2023-11-29rustdoc: Move `AssocItemRender` and `RenderMode` to `html::render`.Alona Enraght-Moony-20/+21
They're only used for HTML, so it makes more sense for them to live their.
2023-11-27Address unused tuple struct fields in rustdocJake Goulding-6/+3
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).