about summary refs log tree commit diff
path: root/src/librustdoc/clean
AgeCommit message (Collapse)AuthorLines
2022-01-28Remove now-unnecessary blanket impl HIR checkRune Tynan-22/+5
2022-01-28Set visibility to inherited in trait impls to match HIRRune Tynan-1/+10
2022-01-28Remove extra empty doc lineGuillaume Gomez-1/+0
2022-01-26Convert empty tuple to DefaultReturn in ty pathRune Tynan-1/+8
2022-01-26Don't use is_local to determine function cleaning method call intentRune Tynan-6/+5
2022-01-25Auto merge of #93095 - Aaron1011:remove-assoc-ident, r=cjgillotbors-6/+5
Store a `Symbol` instead of an `Ident` in `AssocItem` This is the same idea as #92533, but for `AssocItem` instead of `VariantDef`/`FieldDef`. With this change, we no longer have any uses of `#[stable_hasher(project(...))]`
2022-01-25Auto merge of #92353 - Kobzol:doc-attr-lists-gat, r=GuillaumeGomezbors-46/+17
Rustdoc: remove ListAttributesIter and use impl Iterator instead This is a continuation of https://github.com/rust-lang/rust/pull/92227. I found that `ListAttributesIter` did not optimize well and replacing it with a simple `impl Iterator` resulted in 1-3 % instruction count wins locally. Because I needed to use `impl Iterator` on a slice of AST attributes, I had to implement it using GAT + impl trait. I also have a version without GAT [here](https://github.com/Kobzol/rust/commit/5470e2a65cbd3086d19f0847f44ca9cbbc049689), if GATs are not welcome in rustdoc :D Locally it resulted in equal performance numbers. Can I ask for a perf. run? Thanks. r? rust-lang/rustdoc
2022-01-25Rollup merge of #93169 - CraftSpider:rustdoc-clean-inconsistency, ↵Matthias Krüger-6/+22
r=GuillaumeGomez Fix inconsistency of local blanket impls When a blanket impl is local, go through HIR instead of middle. This fixes inconsistencies with data detected during JSON generation. Expected this change to take longer. I also tried doing the whole item through existing clean architecture, but it didn't work out trivially, and felt like it would have added more complexity than it removed. Properly fixes #83718
2022-01-21rustdoc: Make some `pub` items crate-privateNoah Lev-10/+10
They don't need to be `pub`. Making them crate-private improves code clarity and `dead_code` linting.
2022-01-21Remove FIXME and fix inconsistency of local blanket impls by using HIR for themRune Tynan-6/+22
2022-01-20Rollup merge of #93038 - GuillaumeGomez:block-doc-comments, r=notriddleMatthias Krüger-2/+2
Fix star handling in block doc comments Fixes #92872. Some extra explanation about this PR and why https://github.com/rust-lang/rust/pull/92357 created this regression: when we merge doc comment kinds for example in: ```rust /// he /** * hello */ #[doc = "boom"] ``` We don't want to remove the empty lines between them. However, to correctly compute the "horizontal trim", we still need it, so instead, I put back a part of the "vertical trim" directly in the "horizontal trim" computation so it doesn't impact the output buffer but allows us to correctly handle the stars. r? ``@camelid``
2022-01-20More clean upGuillaume Gomez-8/+4
2022-01-20Extra cfg_hide a bit to handle inner cfgsGuillaume Gomez-15/+9
2022-01-20Exclude "test" from doc_auto_cfg renderingGuillaume Gomez-16/+50
2022-01-19Store a `Symbol` instead of an `Ident` in `AssocItem`Aaron Hill-6/+5
This is the same idea as #92533, but for `AssocItem` instead of `VariantDef`/`FieldDef`. With this change, we no longer have any uses of `#[stable_hasher(project(...))]`
2022-01-19Correctly handle starts in block doc commentsGuillaume Gomez-2/+2
2022-01-18Invert the keyword list to list only *no* space before delimDavid Tolnay-38/+60
2022-01-18Eliminate string comparison from rustdoc keyword spacing logicDavid Tolnay-6/+33
2022-01-18Move render_macro_matcher to own moduleDavid Tolnay-189/+194
2022-01-18Render more readable macro matchers in rustdocDavid Tolnay-4/+139
2022-01-17Add term to ExistentialProjectionkadmin-1/+1
Also prevent ICE when adding a const in associated const equality.
2022-01-17Update w/ commentskadmin-4/+1
Removes uses of ty() where a method is implemented on TypeFoldable, and also directly formats a Term.
2022-01-17Update term for use in more placeskadmin-30/+81
Replace use of `ty()` on term and use it in more places. This will allow more flexibility in the future, but slightly worried it allows items which are consts which only accept types.
2022-01-17Use Term in ProjectionPredicatekadmin-8/+10
ProjectionPredicate should be able to handle both associated types and consts so this adds the first step of that. It mainly just pipes types all the way down, not entirely sure how to handle consts, but hopefully that'll come with time.
2022-01-17add eq constraints on associated constantskadmin-1/+2
2022-01-17fix #90187zredb-13/+1
remove the definition of def_id_no_primitives and change; a missing use was modified; narrow the Cache accessibility of BadImplStripper;
2022-01-17fix #90187zredb-0/+1
2022-01-16Auto merge of #92805 - BoxyUwU:revert-lazy-anon-const-substs, r=lcnrbors-1/+1
partially revertish `lazily "compute" anon const default substs` reverts #87280 except for some of the changes around `ty::Unevaluated` having a visitor and a generic for promoted why revert: <https://github.com/rust-lang/rust/pull/92805#issuecomment-1010736049> r? `@lcnr`
2022-01-15Return a LocalDefId in get_parent_item.Camille GILLOT-1/+1
2022-01-15Rustdoc: remove ListAttributesIter and use impl Iterator insteadJakub Beránek-46/+17
2022-01-15initial revertEllen-1/+1
2022-01-14rustdoc: avoid many `Symbol` to `String` conversions.Nicholas Nethercote-6/+3
Particularly when constructing file paths and fully qualified paths. This avoids a lot of allocations, speeding things up on almost all examples.
2022-01-13Rollup merge of #92334 - dtolnay:rustdocmatcher, r=camelid,GuillaumeGomezMatthias Krüger-6/+55
rustdoc: Preserve rendering of macro_rules matchers when possible Fixes #92331. This approach restores the behavior prior to #86282 **if** the matcher token held by the compiler **and** the matcher token found in the source code are identical TokenTrees. Thus #86208 remains fixed, but without regressing formatting for the vast majority of macros which are not macro-generated.
2022-01-11Store a `Symbol` instead of an `Ident` in `VariantDef`/`FieldDef`Aaron Hill-2/+2
The field is also renamed from `ident` to `name. In most cases, we don't actually need the `Span`. A new `ident` method is added to `VariantDef` and `FieldDef`, which constructs the full `Ident` using `tcx.def_ident_span()`. This method is used in the cases where we actually need an `Ident`. This makes incremental compilation properly track changes to the `Span`, without all of the invalidations caused by storing a `Span` directly via an `Ident`.
2022-01-11Auto merge of #92601 - camelid:more-intra-doc-cleanup, r=Manishearthbors-2/+1
rustdoc: Remove the intra-doc links side channel The side channel made the code much more complex and harder to understand. It was added as a temporary workaround in 0c99d806eabd32a2ee2e6c71b400222b99c659e1, but it's no longer necessary. The addition of `UrlFragment` in #92088 was the key to getting rid of the side channel. The semantic information (rather than the strings that used to be used for fragments) that is now captured by `UrlFragment` is enough to obviate the side channel. An additional change had to be made to `UrlFragment` in this PR to make this possible: it now records `DefId`s rather than item names. This PR also consolidates the checks for anchor conflicts into one place. r? `@Manishearth`
2022-01-09Auto merge of #92690 - matthiaskrgr:rollup-rw0oz05, r=matthiaskrgrbors-101/+104
Rollup of 8 pull requests Successful merges: - #92055 (Add release notes for 1.58) - #92490 (Move crate drop-down to search results page) - #92510 (Don't resolve blocks in foreign functions) - #92573 (expand: Refactor InvocationCollector visitor for better code reuse) - #92608 (rustdoc: Introduce a resolver cache for sharing data between early doc link resolution and later passes) - #92657 (Implemented const casts of raw pointers) - #92671 (Make `Atomic*::from_mut` return `&mut Atomic*`) - #92673 (Remove useless collapse toggle on "all items" page) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-01-09Rollup merge of #92608 - petrochenkov:doctrscope3, r=CraftSpiderMatthias Krüger-101/+104
rustdoc: Introduce a resolver cache for sharing data between early doc link resolution and later passes The refactoring parts of https://github.com/rust-lang/rust/pull/88679, shouldn't cause any slowdowns. r? `@jyn514`
2022-01-09rustc_metadata: Rename `item_children(_untracked)` to ↵Vadim Petrochenkov-3/+3
`module_children(_untracked)` And `each_child_of_item` to `for_each_module_child`
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-07rustdoc: Introduce a resolver cache for sharing data between early doc link ↵Vadim Petrochenkov-101/+104
resolution and later passes
2022-01-06Use `DefId`s instead of names in `UrlFragment`Noah Lev-2/+1
This is the next step in computing more "semantic" information during intra-doc link collection and then doing rendering all at the end.
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-28Replace &DocCtxt -> TyCtxt in macro matcher renderingDavid Tolnay-9/+9