about summary refs log tree commit diff
path: root/src/librustdoc/formats/mod.rs
AgeCommit message (Collapse)AuthorLines
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-1/+1
2024-09-07rustdoc: use a single box to store Attributes and ItemKindMichael Howell-1/+1
2024-07-29Reformat `use` declarations.Nicholas Nethercote-2/+1
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2023-11-29rustdoc: Move `AssocItemRender` and `RenderMode` to `html::render`.Alona Enraght-Moony-15/+0
They're only used for HTML, so it makes more sense for them to live their.
2023-01-10Remove unneeded ItemId::Primitive variantGuillaume Gomez-6/+0
2022-06-04Don't generate "Impls on Foreign Types" for stdJacob Hoffman-Andrews-2/+15
Hack: many traits and types in std are re-exported from core or alloc. In general, rustdoc is capable of recognizing these implementations as being on local types. However, in at least one case, rustdoc gets confused and labels an implementation as being on a foreign type. To make sure that confusion doesn't pass on to the reader, consider all implementations in std, core, and alloc to be on local types.
2022-06-02Rollup merge of #97613 - jsha:implementation-is-on-local-type, r=GuillaumeGomezYuki Okushi-0/+25
rustdoc: Improve calculation of "Impls on Foreign Types" The existing code to calculate whether an implementation was on a "Foreign Type" was duplicated across the sidebar generation and the page generation. It also came to the wrong conclusion for some cases where both the trait and the "for" type were re-exports. This PR extracts the logic into a method of `Impl`, breaks it into a multi-line method so it can be commented, and adds a case for when the trait and the "for" type came from the same crate. This fixes some cases - like the platform-specific integer types (`__m256`, `__m128`, etc). But it doesn't fix all cases. See the screenshots below. [Before](https://doc.rust-lang.org/nightly/std/clone/trait.Clone.html#foreign-impls): <img src="https://user-images.githubusercontent.com/220205/171338226-59ce6daf-3d76-4bad-bc8d-72a8259a8f43.png" width=200> [After](https://rustdoc.crud.net/jsha/implementation-is-on-local-type/std/clone/trait.Clone.html): <img src="https://user-images.githubusercontent.com/220205/171338147-28308a65-1597-4223-be47-9550062404dd.png" width=200> The remaining types (`CString`, `NulError`, etc) are all from the `alloc` crate, while the `Clone` trait is from the `core` crate. Since `CString` and `Clone` are both re-exported by `std`, they are logically local to each other, but I couldn't figure out a good way to detect that in this code. I figure this is still a good step forward. Related: #97610 r? `@camelid`
2022-06-01Improve calculation of "Impls on Foreign Types"Jacob Hoffman-Andrews-0/+25
2022-05-21Remove `crate` visibility modifier in libs, testsJacob Pratt-11/+11
2022-04-17Fix rustdoc duplicated blanket impls issueGuillaume Gomez-1/+21
2021-09-30Remove temporary `GetDefId` impl for `Path`Noah Lev-7/+1
2021-09-30Make `Impl.trait_` a `Path`, not a `Type`Noah Lev-1/+1
It should only ever be a `ResolvedPath`, so this (a) enforces that, and (b) reduces the size of `Impl`. I had to update a test because the order of the rendered auto trait impl bounds changed. I think the order changed because rustdoc sorts auto trait bounds using their `Debug` output.
2021-05-04Add type to differentiate between fake and real DefId'sJustus K-2/+2
2021-01-27Remove cache usage wherever possibleGuillaume Gomez-2/+6
2021-01-27Remove CACHE_KEY globalGuillaume Gomez-2/+3
2020-12-23Box ItemKind to reduce the size of `Item`Joshua Nelson-1/+1
This brings the size of `Item` from ``` [src/librustdoc/lib.rs:103] std::mem::size_of::<Item>() = 680 ``` to ``` [src/librustdoc/lib.rs:103] std::mem::size_of::<Item>() = 280 ```
2020-11-15Make all rustdoc functions and structs crate-privateJoshua Nelson-10/+10
This gives warnings about dead code.
2020-11-14Rename ItemEnum -> ItemKind, inner -> kindJoshua Nelson-1/+1
2020-07-27More requested changesJoseph Ryan-1/+1
2020-07-27Make requested changesJoseph Ryan-0/+4
2020-07-27Pull out more types from htmlJoseph Ryan-0/+11
2020-07-27Extract `Cache` and other types from `html` moduleJoseph Ryan-97/+19
2020-07-27Refactor html backend to use generic interfaceJoseph Ryan-0/+107