about summary refs log tree commit diff
path: root/src/librustdoc/passes
AgeCommit message (Collapse)AuthorLines
2022-01-17fix #90187zredb-2/+2
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-8/+11
2022-01-17fix #90187zredb-3/+4
2022-01-17Rollup merge of #92799 - rust-lang:followup-from-92533, r=Aaron1011Matthias Krüger-7/+3
Remove some unnecessary uses of `FieldDef::ident` Followup from #92533. cc ``@Aaron1011`` ``@petrochenkov``
2022-01-16Rollup merge of #92792 - mdibaiee:92662/fix-intra-doc-generics, r=camelidMatthias Krüger-1/+12
rustdoc: fix intra-link for generic trait impls fixes #92662 r? `````@camelid`````
2022-01-16Rollup merge of #92635 - camelid:yet-more-cleanup, r=ManishearthMatthias Krüger-157/+159
rustdoc: Yet more intra-doc links cleanup r? `@Manishearth`
2022-01-15Fix broken linkNoah Lev-1/+1
2022-01-13librustdoc: Address some clippy lintspierwill-5/+4
Also ignore clippy's "collapsible if..." lints.
2022-01-13rustdoc: fix intra-link for generic trait implsMahdi Dibaiee-1/+12
2022-01-11Remove some unnecessary uses of `FieldDef::ident`Noah Lev-7/+3
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-10Update some comments post the side channel removalNoah Lev-5/+2
2022-01-10Extract functions for two closuresNoah Lev-73/+107
These closures were quite complex and part of a quite complex function. The fact that they are closures makes mistakes likely when refactoring. For example, earlier, I meant to use `resolved`, an argument of the closure, but I instead typed `res`, which captured a local variable and caused a subtle bug that led to a confusing test failure. Extracting them as functions makes the code easier to understand and refactor.
2022-01-10Update comment and make code clearerNoah Lev-5/+4
I'm still not sure why this hack works so seemingly well.
2022-01-10Remove unnecessary conditional for suggesting disambiguatorNoah Lev-4/+1
Now that `res` is used directly, it seems the conditional is unnecessary.
2022-01-10Use Res instead of Disambiguator for `resolved` in `report_mismatch`Noah Lev-65/+50
This allows simplifying a lot of code. It also fixes a subtle bug, exemplified by the test output changes.
2022-01-10Remove hack that is no longer necessaryNoah Lev-11/+1
This hack was added in 6ab1f05697c3f2df4e439a05ebcee479a9a16d80. I don't know what change allowed removing the hack, but that commit added a test (which I presume covered the hack's behavior), and all tests are passing with this change. So, I think it should be good.
2022-01-11Auto merge of #92601 - camelid:more-intra-doc-cleanup, r=Manishearthbors-140/+147
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-07rustdoc: Introduce a resolver cache for sharing data between early doc link ↵Vadim Petrochenkov-92/+129
resolution and later passes
2022-01-06Split out `ItemFragment` from `UrlFragment`Noah Lev-39/+49
This allows eliminating branches in the code where a user-written fragment is impossible.
2022-01-06Remove the side channelNoah Lev-44/+11
Hooray! It was no longer used, so it can just be deleted.
2022-01-06Remove the last use of the side channelNoah Lev-4/+13
2022-01-06Use fragment instead of side channel in another placeNoah Lev-1/+5
2022-01-06Use fragment instead of side channel for prim. assoc. itemsNoah Lev-1/+3
I had the epiphany that now that fragments are "semantic" -- rather than just strings -- they fill the role that used to be handled by the side channel. I think I may be able to get rid of the other uses of the side channel using this technique too.
2022-01-06Extract function for reporting feature gate errorNoah Lev-16/+15
2022-01-06Only check for conflicting anchors in one placeNoah Lev-24/+34
This coalesces the checks into one place.
2022-01-06Use `DefId`s instead of names in `UrlFragment`Noah Lev-44/+48
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-06Move anchor conflict check to call siteNoah Lev-6/+8
I think it makes the code easier to understand.
2022-01-06Rollup merge of #92443 - mdibaiee:90703/resolve-traits-of-primitive-types, ↵Matthias Krüger-21/+71
r=Manishearth Rustdoc: resolve associated traits for non-generic primitive types Fixes #90703 This seems to work: <img width="457" alt="image" src="https://user-images.githubusercontent.com/2807772/147774059-9556ff96-4519-409e-8ed0-c33ecc436171.png"> I'm just afraid I might have missed some cases / broken previous functionality. I also have not written tests yet, I will have to take a look to see where tests are and how they are structured, but any help there is also appreciated.
2022-01-06Rollup merge of #92349 - avitex:fix-rustdoc-private-doc-tests, r=GuillaumeGomezMatthias Krüger-1/+1
Fix rustdoc::private_doc_tests lint for public re-exported items Closes #72081 This involves changing the lint to check the access level is exported, rather than public. The [exported access level](https://github.com/rust-lang/rust/blob/e91ad5fc62bdee4a29c18baa5fad2ca42fc91bf4/compiler/rustc_middle/src/middle/privacy.rs#L24) accounts for public items and items accessible to other crates with the help of `pub use` re-exports. The pattern of re-exporting public items from a private module is usage seen in a number of popular crates.
2022-01-05Remove unsupported types in primitive_to_ty conversion, add FIXME noteMahdi Dibaiee-8/+3
2022-01-05Rustdoc: resolve associated traits for primitive typesMahdi Dibaiee-21/+76
Fixes #90703
2021-12-30Auto merge of #92377 - compiler-errors:rustdoc-lifetimes, r=camelid,jyn514bors-2/+2
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-28remove in_band_lifetimes from librustdocMichael Goulet-2/+2
2021-12-28Explain why struct fields are handled by assoc. item codeNoah Lev-0/+12
2021-12-28Only special case struct fields for intra-doc links, not enum variantsJoshua Nelson-16/+13
Variants are already handled by `resolve_str_path_error`, rustdoc doesn't need to consider them separately.
2021-12-28rustc_metadata: Encode list of all crate's traits into metadataVadim Petrochenkov-1/+1
2021-12-28Fix rustdoc::private_doc_tests lint for public re-exported itemsavitex-1/+1
This involves changing the lint to check the access level is exported, rather than public. The exported access level accounts for public items and items accessible to other crates with the help of `pub use` re-exports. The pattern of re-exporting public items from a private module is usage seen in a number of popular crates.
2021-12-27intra-doc: Use an enum to represent URL fragmentsNoah Lev-75/+109
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-27Remove needless `return`Noah Lev-1/+1
2021-12-23Rustdoc: use `is_doc_hidden` method on more placesJakub Beránek-8/+2
2021-12-21Auto merge of #92095 - vacuus:master, r=jyn514bors-1/+0
rustdoc: Remove 'need_backline' field from `DocFragment` Fixes [#92084](https://github.com/rust-lang/rust/issues/92084)
2021-12-20Auto merge of #91900 - pitaj:fix-91714, r=jyn514bors-20/+2
rustdoc: make `--passes` and `--no-defaults` have no effect Fixes #91714 One potential issue is that currently there is no stable way to achieve `--document-hidden-items`. This affects test `issue-15347`. I also had to modify the tests `issue-42875` and `no-compiler-export`. Regardless of combinations of `--document-hidden-items` and `--document-private-items`, I was unable to get these to pass without the modifications. I left behind a comment noting the change.
2021-12-19Remove 'need_backline' field of `DocFragment`Roc Yu-1/+0
2021-12-19Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obkbors-2/+2
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-18Write code directly instead of using FromIteratorNoah Lev-1/+4
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-16Rollup merge of #91987 - jsha:docdocgoose, r=jyn514Matthias Krüger-0/+30
Add module documentation for rustdoc passes These are currently documented at https://rustc-dev-guide.rust-lang.org/rustdoc-internals.html#hot-potato but can easily go out of date. We'd like to document them in place and link to https://doc.rust-lang.org/nightly/nightly-rustc/rustdoc/passes/index.html [Discussed on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/moving.20pass.20docs/near/265058351). r? `@camelid`
2021-12-15Add module documentation for rustdoc passesJacob Hoffman-Andrews-0/+30
These are currently documented at https://rustc-dev-guide.rust-lang.org/rustdoc-internals.html#hot-potato but can easily go out of date. We'd like to document them in place and link to https://doc.rust-lang.org/nightly/nightly-rustc/rustdoc/passes/index.html
2021-12-15rustdoc: remove `--passes` and `--no-defaults`Peter Jaszkowiak-20/+2
- flags no longer function, see #44136 - adjust tests to match new behavior - removed test issue-42875 (covered regression with --no-defaults) - moved input-format to removed flags - move all removed flags to bottom - note flag removal in command help - remove DefaultPassOption enum (now redundant with `show_coverage`)