summary refs log tree commit diff
path: root/src/librustdoc/clean
AgeCommit message (Collapse)AuthorLines
2022-01-08Auto merge of #91305 - camelid:rm-cond, r=GuillaumeGomezbors-3/+0
rustdoc: Remove apparently unnecessary conditional in `doc_value` I need to remove this conditional for #91072, but while it seems unnecessary, we are not certain. So, the plan is to first remove the conditional and see if any regressions pop up before doing the refactor. This way, it will be easier to revert if there are subtle regressions. r? `@jyn514`
2022-01-05Rollup merge of #92188 - vacuus:nested-attributes-ext, r=jyn514Matthias Krüger-10/+15
rustdoc: Clean up NestedAttributesExt trait/implementation
2022-01-04Rollup merge of #91907 - lcnr:const-arg-infer, r=BoxyUwUMatthias Krüger-11/+17
Allow `_` as the length of array types and repeat expressions r? `@BoxyUwU` cc `@varkor`
2022-01-03Auto merge of #92395 - Kobzol:rustdoc-bindings-thin-vec, r=camelidbors-7/+9
Rustdoc: use ThinVec for GenericArgs bindings The bindings are almost always empty. This reduces the size of `PathSegment` and `GenericArgs` by about one fourth.
2022-01-01Rustdoc: use ThinVec for GenericArgs bindingsJakub Beránek-7/+9
2021-12-30Auto merge of #92377 - compiler-errors:rustdoc-lifetimes, r=camelid,jyn514bors-9/+9
remove in_band_lifetimes from librustdoc r? `@camelid` closes #92368
2021-12-29Auto merge of #92244 - petrochenkov:alltraits, r=cjgillotbors-1/+1
rustc_metadata: Encode list of all crate's traits into metadata While working on https://github.com/rust-lang/rust/pull/88679 I noticed that rustdoc is casually doing something quite expensive, something that is used only for error reporting in rustc - collecting all traits from all crates in the dependency tree. This PR trades some minor extra time spent by metadata encoder in rustc for major gains for rustdoc (and for rustc runs with errors, which execute the `all_traits` query for better diagnostics).
2021-12-29Rollup merge of #92340 - camelid:search-index-cleanup, r=GuillaumeGomezMatthias Krüger-1/+10
rustdoc: Start cleaning up search index generation I'm trying to simplify and clean up the code, partly to make #90779 easier. r? `@GuillaumeGomez`
2021-12-28remove in_band_lifetimes from librustdocMichael Goulet-9/+9
2021-12-28rustc_metadata: Encode list of all crate's traits into metadataVadim Petrochenkov-1/+1
2021-12-27Move `ExternalLocation` to `clean::types`Noah Lev-1/+10
It was previously defined in `render::search_index` but wasn't used at all there. `clean::types` seems like a better fit since that's where `ExternalCrate` is defined.
2021-12-27Rename `rustdoc::html::render::cache` to `search_index`Noah Lev-1/+1
The old name wasn't very clear, while the new one makes it clear that this is the code responsible for creating the search index.
2021-12-27intra-doc: Use an enum to represent URL fragmentsNoah Lev-3/+4
This is a step in the direction of computing the links more lazily, which I think will simplify the implementation of intra-doc links. This will also make it easier to eventually use the actual `Res` for associated items, enum variants, and fields, rather than their HTML page's `Res`.
2021-12-25Auto merge of #92262 - notriddle:notriddle/unused-hash, r=jyn514bors-11/+2
rustdoc: remove unused Hash impl
2021-12-25Auto merge of #92227 - Kobzol:rustdoc-doc-hidden, r=jyn514bors-4/+4
Rustdoc: use `is_doc_hidden` method on more places While profiling `rustdoc`, I noticed that finding out if some item is marked with `#[doc(hidden)]` is relatively hot, so I tried to optimize it. I noticed that there is already a method called `is_doc_hidden` on `TyCtxt`, but it wasn't used much, so I replaced the manual calls to `attrs(...).has_word(...)` with this method. Just by doing that, perf. was improved locally, although I'm not sure if the semantics of the previous calls and this method are the same? As another step, I tried to querify `is_doc_hidden`, but I didn't include that here until we see the perf. results from the first commit and until I find whether this change is OK at all :) Can I ask for a perf. run? Thanks. r? `@jyn514`
2021-12-24rustdoc: remove unused Hash implMichael Howell-11/+2
2021-12-23Clean up NestedAttributesExt trait/implementationRoc Yu-10/+15
2021-12-23Do not display `~const Drop` in rustdocDeadbeef-20/+35
2021-12-23Rustdoc: use `is_doc_hidden` method on more placesJakub Beránek-4/+4
2021-12-23fix rustdoclcnr-11/+17
2021-12-21Remove apparently unnecessary conditional in `doc_value`Noah Lev-3/+0
I need to remove this conditional for #91072, but while it seems unnecessary, we are not certain. So, the plan is to first remove the conditional and see if any regressions pop up before doing the refactor. This way, it will be easier to revert if there are subtle regressions.
2021-12-19Remove 'need_backline' field of `DocFragment`Roc Yu-28/+18
2021-12-19Omit check of a successive line in loopvacuus-6/+10
I think that s == "" is the only edge case (as it makes iter.next() return None the first time). The early return is necessary so that the last character of 'out' isn't popped if s == "" && !frag.need_backline
2021-12-19Auto merge of #92099 - matthiaskrgr:rollup-4gwv67m, r=matthiaskrgrbors-10/+5
Rollup of 7 pull requests Successful merges: - #91141 (Revert "Temporarily rename int_roundings functions to avoid conflicts") - #91984 (Remove `in_band_lifetimes` from `rustc_middle`) - #92028 (Sync portable-simd to fix libcore build for AVX-512 enabled targets) - #92042 (Enable `#[thread_local]` for all windows-msvc targets) - #92071 (Update example code for Vec::splice to change the length) - #92077 (rustdoc: Remove unused `collapsed` field) - #92081 (rustdoc: Remove unnecessary `need_backline` function) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-12-19Rollup merge of #92081 - jyn514:need-backline, r=GuillaumeGomezMatthias Krüger-7/+3
rustdoc: Remove unnecessary `need_backline` function r? `@GuillaumeGomez`
2021-12-19Rollup merge of #92077 - jyn514:remove-collapsed, r=GuillaumeGomezMatthias Krüger-3/+2
rustdoc: Remove unused `collapsed` field `render/context` always runs after `run_global_context`, so it was always set to `true`. This is a holdover from when rustdoc allowed configuring passes, but the `collapse-docs` pass was removed ages ago, and the ability to configure passes is about to be removed. Found while reviewing https://github.com/rust-lang/rust/pull/91305.
2021-12-19Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obkbors-14/+10
Remove `SymbolStr` This was originally proposed in https://github.com/rust-lang/rust/pull/74554#discussion_r466203544. As well as removing the icky `SymbolStr` type, it allows the removal of a lot of `&` and `*` occurrences. Best reviewed one commit at a time. r? `@oli-obk`
2021-12-19Rollup merge of #92082 - jyn514:remove-from-iterator, r=jyn514Matthias Krüger-11/+12
rustdoc: Write doc-comments directly instead of using FromIterator The FromIterator impl made the code much harder to understand. The types don't make sense until you realize there's a custom FromIterator impl. This is the first commit from https://github.com/rust-lang/rust/pull/91305; since ``@camelid`` wrote it originally I don't feel bad unilaterally approving it. r? ``@ghost`` ``@bors`` r+ Note that this will conflict with https://github.com/rust-lang/rust/pull/92078.
2021-12-18Write code directly instead of using FromIteratorNoah Lev-11/+12
The FromIterator impl made the code much harder to understand. The types don't make sense until you realize there's a custom FromIterator impl.
2021-12-18Remove unnecessary `need_backline` functionJoshua Nelson-7/+3
2021-12-18Remove `collapsed` fieldJoshua Nelson-3/+2
`render/context` always runs after `run_global_context`, so it was always set to `true`. This is a holdover from when rustdoc allowed configuring passes, but the `collapse-docs` pass was removed ages ago, and the ability to configure passes is about to be removed.
2021-12-18hir: Do not introduce dummy type names for `extern` blocks in def pathsVadim Petrochenkov-3/+3
Use a separate nameless `DefPathData` variant instead
2021-12-17Auto merge of #91812 - camelid:assoc-const-lazy, r=GuillaumeGomezbors-7/+24
rustdoc: Pretty-print assoc const defaults on-demand This should improve performance, clean up the code, and help pave the way for #83035.
2021-12-16Auto merge of #91833 - klensy:rd-minus-alloc, r=jyn514bors-11/+6
rustdoc: don't clone already owned `Path` and modify it inplace
2021-12-15Remove unnecessary sigils around `Ident::as_str()` calls.Nicholas Nethercote-1/+1
2021-12-15Remove unnecessary sigils around `Symbol::as_str()` calls.Nicholas Nethercote-8/+8
2021-12-15Remove `SymbolStr`.Nicholas Nethercote-5/+1
By changing `as_str()` to take `&self` instead of `self`, we can just return `&str`. We're still lying about lifetimes, but it's a smaller lie than before, where `SymbolStr` contained a (fake) `&'static str`!
2021-12-12don't alloc Path and mutate it inplaceklensy-11/+6
2021-12-12Revert "Auto merge of #91491 - spastorino:revert-91354, r=oli-obk"Deadbeef-2/+3
This reverts commit ff2439b7b9bafcfdff86b7847128014699df8442, reversing changes made to 2a9e0831d6603d87220cedd1b1293e2eb82ef55c.
2021-12-11rustdoc: Pretty-print assoc const defaults on-demandNoah Lev-7/+24
This should improve performance, clean up the code, and help pave the way for #83035.
2021-12-03Remove single-use `GenericParamDef::get_type` functionNoah Lev-15/+0
Rationale: * The name was confusing. * It was only used in one place. * That place didn't actually need all the functionality of `get_type`; rather, removing `get_type` makes that code clearer.
2021-12-03rustdoc: Remove single-use `Lifetime::get_ref()` functionNoah Lev-4/+0
2021-12-03Remove a Clean impl for a tuple (9)Noah Lev-43/+48
This was the last one!
2021-12-03Remove a Clean impl for a tuple (8)Noah Lev-86/+89
2021-12-03Remove a Clean impl for a tuple (7)Noah Lev-26/+28
2021-12-03Remove a Clean impl for a tuple (6)Noah Lev-16/+17
2021-12-03Remove a Clean impl for a tuple (5)Noah Lev-19/+20
2021-12-03Remove a Clean impl for a tuple (4)Noah Lev-14/+17
2021-12-03Clean up definition of `clean_ty_generics` a bitNoah Lev-5/+3
2021-12-03Remove a Clean impl for a tuple (3)Noah Lev-165/+172