about summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2023-07-25Use a builder instead of boolean/option argumentsOli Scherer-8/+5
2023-07-25Improve performance of `first_non_private`Guillaume Gomez-22/+18
2023-07-25Auto merge of #113958 - lukas-code:doc-links, r=GuillaumeGomez,petrochenkovbors-16/+31
fix intra-doc links on nested `use` and `extern crate` items This PR fixes two rustdoc ICEs that happen if there are any intra-doc links on nested `use` or `extern crate` items, for example: ```rust /// Re-export [`fmt`] and [`io`]. pub use std::{fmt, io}; // "nested" use = use with braces /// Re-export [`std`]. pub extern crate std; ``` Nested use items were incorrectly considered private and therefore didn't have their intra-doc links resolved. I fixed this by always resolving intra-doc links for nested `use` items that are declared `pub`. <details> During AST->HIR lowering, nested `use` items are desugared like this: ```rust pub use std::{}; // "list stem" pub use std::fmt; pub use std::io; ``` Each of these HIR nodes has it's own effective visibility and the list stem is always considered private. To check the effective visibility of an AST node, the AST node is mapped to a HIR node with `Resolver::local_def_id`, which returns the (private) list stem for nested use items. </details> For `extern crate`, there was a hack in rustdoc that stored the `DefId` of the crate itself in the cleaned item, instead of the `DefId` of the `extern crate` item. This made rustdoc look at the resolved links of the extern crate's crate root instead of the `extern crate` item. I've removed this hack and instead translate the `DefId` in the appropriate places. As as side effect of fixing `extern crate`, i've turned ```rust #[doc(masked)] extern crate self as _; ``` into a no-op instead of hiding all trait impls. Proper verification for `doc(masked)` is included as a bonus. fixes https://github.com/rust-lang/rust/issues/113896
2023-07-24Cache qpath first public resultGuillaume Gomez-27/+50
2023-07-24Revert "Remove needs for transmute"Guillaume Gomez-28/+20
This reverts commit ea9a17b9995b7a076283777b7d462a360fece2d6.
2023-07-24Remove needs for transmuteGuillaume Gomez-20/+28
2023-07-24Re-add missing generics in `first_non_private`Guillaume Gomez-3/+23
2023-07-24Add support for `--document-hidden-items` in `first_non_private`Guillaume Gomez-1/+2
2023-07-24Add test for private itemsGuillaume Gomez-0/+3
2023-07-24Correctly handle `super` and `::`Guillaume Gomez-1/+10
2023-07-24Rename `first_not_private` into `first_non_private`Guillaume Gomez-2/+2
2023-07-24Improve code readabilityGuillaume Gomez-32/+27
2023-07-24If re-export is private, get the next item until a public one is found or ↵Guillaume Gomez-3/+93
expose the private item directly
2023-07-24Fix missing attribute merge on glob foreign re-exportsGuillaume Gomez-18/+39
2023-07-22fix doc links on `extern crate` itemsLukas Markeffsky-14/+23
2023-07-22rustdoc: handle cross-crate RPITITs correctlyLeón Orell Valerian Liehr-3/+6
2023-07-22improve debuggabilityLukas Markeffsky-2/+8
2023-07-20Rollup merge of #113883 - steffahn:rustdoc-search-crate-selector-padding, ↵Matthias Krüger-9/+0
r=GuillaumeGomez Remove outdated Firefox-specific CSS for search's crate selector appearance Remove adjustments that used to be necessary for search's crate selector appearance (padding) to look identical on Firefox. New versions of Firefox appear to have changed behavior to agree with Chrome. As briefly discussed in https://github.com/rust-lang/rust/pull/98855#issuecomment-1624098112 r? ``@GuillaumeGomez``
2023-07-20Rollup merge of #113835 - lcnr:assemble-candidates-considering-self-ty, ↵Matthias Krüger-28/+27
r=compiler-errors new solver: don't consider blanket impls multiple times only consider candidates which rely on the self type in `assemble_candidates_after_normalizing_self_ty`. r? ``@compiler-errors``
2023-07-20Rollup merge of #110765 - wackbyte:fix-defaultness-position, ↵Matthias Krüger-4/+4
r=fmease,GuillaumeGomez rustdoc: fix position of `default` in method rendering With the following code: ```rs #![feature(specialization)] pub trait A { unsafe fn a(); } impl A for () { default unsafe fn a() {} } ``` rustdoc would render the `impl` of `a` as ```rs unsafe default fn a() ``` which is inconsistent with the actual position of `default`. This PR fixes this issue.
2023-07-20XSimplifiedType to SimplifiedType::Xlcnr-28/+27
2023-07-20Remove adjustments that used to be necessary for search's crate selector ↵Frank Steffahn-9/+0
appearance (padding) to look identical on Firefox. New versions of Firefox appear to have changed behavior to agree with Chrome.
2023-07-20Auto merge of #108714 - estebank:ice_dump, r=oli-obkbors-3/+6
On nightly, dump ICE backtraces to disk Implement rust-lang/compiler-team#578. When an ICE is encountered on nightly releases, the new rustc panic handler will also write the contents of the backtrace to disk. If any `delay_span_bug`s are encountered, their backtrace is also added to the file. The platform and rustc version will also be collected. <img width="1032" alt="Screenshot 2023-03-03 at 2 13 25 PM" src="https://user-images.githubusercontent.com/1606434/222842420-8e039740-4042-4563-b31d-599677171acf.png"> The current behavior will *always* write to disk on nightly builds, regardless of whether the backtrace is printed to the terminal, unless the environment variable `RUSTC_ICE_DISK_DUMP` is set to `0`. This is a compromise and can be changed.
2023-07-19Rollup merge of #113785 - GuillaumeGomez:tests/rustdoc/issue-105735-fix, ↵Dylan DPC-17/+41
r=notriddle,aDotInTheVoid Fix invalid display of inlined re-export when both local and foreign items are inlined Fixes #105735. The bug is actually quite interesting: at the `clean` pass, local inlined items have their `use` item removed, however foreign items don't have their `use` item removed because it's in the `clean` pass that we handle them. So when a `use` inlines both a local and a foreign item, it will work as expected for the foreign one, but not for the local as its `use` should not be around anymore. To prevent this, I created a new `inlined_foreigns` field into the `Module` struct to allow to remove the `use` item early on for foreign items as well. Then we iterate it in the `clean` pass directly. r? ``@notriddle``
2023-07-19On nightly, dump ICE backtraces to diskEsteban Küber-3/+6
Implement rust-lang/compiler-team#578. When an ICE is encountered on nightly releases, the new rustc panic handler will also write the contents of the backtrace to disk. If any `delay_span_bug`s are encountered, their backtrace is also added to the file. The platform and rustc version will also be collected.
2023-07-18Rollup merge of #113823 - GuillaumeGomez:fix-results-search-alias-display, ↵Matthias Krüger-19/+15
r=notriddle Fix results search alias display Currently it's displayed like this: ![Screenshot from 2023-07-18 14-23-35](https://github.com/rust-lang/rust/assets/3050060/119d8f18-b298-4e6f-9571-9f678fc19126) With this fix: ![Screenshot from 2023-07-18 14-23-29](https://github.com/rust-lang/rust/assets/3050060/679d6241-420e-4f13-be78-dc061cbc488a) r? `@notriddle`
2023-07-18Fix display of aliases in rustdoc search resultsGuillaume Gomez-19/+15
2023-07-18support for mips32r6 as a target_arch valuechenx97-0/+1
2023-07-18support for mips64r6 as a target_arch valuechenx97-0/+1
2023-07-18Remove unneeded `Option<Symbol>` in `foreign_items`Guillaume Gomez-4/+3
2023-07-18Fix invalid display of inlined re-exportGuillaume Gomez-17/+42
2023-07-18Auto merge of #113801 - compiler-errors:iter-instantiated, r=oli-obkbors-2/+2
Rename `arg_iter` to `iter_instantiated` `arg_iter` doesn't make sense, and doesn't really indicate what it's doing (returning an iterator that ~~substitutes~~ instantiates its elements). `iter_instantiated_copied` is kinda awkward but i don't really wanna bikeshed it. r? `@oli-obk`
2023-07-18Auto merge of #113574 - GuillaumeGomez:rustdoc-json-strip-hidden-impl, ↵bors-24/+57
r=aDotInTheVoid,notriddle Strip impl if not re-exported and is doc(hidden) Part of #112852. r? `@aDotInTheVoid`
2023-07-17Rename arg_iter to iter_instantiatedMichael Goulet-2/+2
2023-07-15Auto merge of #113606 - jyn514:parallel-compiler-cleanup, r=cjgillotbors-3/+0
Don't require each rustc_interface tool to opt-in to parallel_compiler Previously, forgetting to call `interface::set_thread_safe_mode` would cause the following ICE: ``` thread 'rustc' panicked at 'uninitialized dyn_thread_safe mode!', /rustc/dfe0683138de0959b6ab6a039b54d9347f6a6355/compiler/rustc_data_structures/src/sync.rs:74:18 ``` This calls `set_thread_safe_mode` in `interface::run_compiler` to avoid requiring it in the caller. Fixes `tests/run-make-fulldeps/issue-19371` when parallel-compiler is enabled. r? `@SparrowLii` cc https://github.com/rust-lang/rust/issues/75760
2023-07-15Auto merge of #113697 - ↵bors-6/+1
GuillaumeGomez:rm-unneeded-externallocation-handling, r=lqd Remove unneeded handling for `ExternalLocation::Unknown` in rustdoc render context Should fix perf regression introduced in https://github.com/rust-lang/rust/pull/113623. r? `@lqd`
2023-07-14rustdoc: rename to `src-script.js`Michael Howell-0/+0
This is a separate commit to keep Git happy.
2023-07-14rustdoc: use `src` consistently over `source` in JavaScriptMichael Howell-21/+21
Since the directory that contains source files is called `src`, it makes sense to name the scripts that way, too.
2023-07-14rustdoc: use `src` consistently over `source` in codeMichael Howell-55/+55
The CSS uses an inconsistent mix of both. This commit switches it to always use `src`.
2023-07-14Correctly handle `--document-hidden-items`Guillaume Gomez-29/+56
2023-07-14Remove unneeded handling for `ExternalLocation::Unknown` in rustdoc render ↵Guillaume Gomez-6/+1
context
2023-07-14Strip impl if not re-exported and is doc(hidden)Guillaume Gomez-1/+7
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-96/+94
2023-07-13Rollup merge of #113623 - GuillaumeGomez:add-jump-to-doc, r=notriddleMatthias Krüger-25/+84
Add jump to doc I'm using the source code pages of the compiler quite a lot, but one thing missing is the possibility to jump back from the source code to the item documentation. Since I also got a few others complaining about it, I think it's fine to add it since this option is nightly only. This PR adds a link to jump back to item's documentation on the item definition (so on `Bar` in `struct Bar {... }`, as described in the unofficial [RFC](https://github.com/GuillaumeGomez/rfcs/blob/rustdoc-jump-to-definition/text/000-rustdoc-jump-to-definition.md)). r? ````@notriddle````
2023-07-12Re-format let-else per rustfmt updateMark Rousskov-50/+53
2023-07-12Add jump to docGuillaume Gomez-25/+84
2023-07-11Don't require each rustc_interface tool to opt-in to parallel_rustc supportjyn-3/+0
Previously, forgetting to call `interface::set_thread_safe_mode` would cause the following ICE: ``` thread 'rustc' panicked at 'uninitialized dyn_thread_safe mode!', /rustc/dfe0683138de0959b6ab6a039b54d9347f6a6355/compiler/rustc_data_structures/src/sync.rs:74:18 ``` This calls `set_thread_safe_mode` in `interface::run_compiler` to avoid requiring it in the caller. Fixes `tests/run-make-fulldeps/issue-19371` when parallel-compiler is enabled.
2023-07-08Replace RPITIT current impl with new strategy that lowers as a GATSantiago Pastorino-3/+2
2023-07-03remove TypeWellFormedFromEnvMichael Goulet-2/+1
2023-07-03Rollup merge of #113285 - GuillaumeGomez:display-long-inline-cfg, r=notriddleGuillaume Gomez-3/+3
[rustdoc] Fix display of long inline cfg labels Fixes #87957. Fixes #112880. Before: ![Screenshot from 2023-07-03 13-25-47](https://github.com/rust-lang/rust/assets/3050060/401e2c6b-2cfd-4ae3-9d15-b5e1dfec4201) After: ![Screenshot from 2023-07-03 13-24-49](https://github.com/rust-lang/rust/assets/3050060/e42a34a8-bf60-409d-8a0c-1669d09e7e1e) r? `@notriddle`