about summary refs log tree commit diff
path: root/src/librustdoc/clean
AgeCommit message (Collapse)AuthorLines
2021-07-13Remove unnecessary CrateNum from Cache.externsJoshua Nelson-8/+8
It can be found from ExternalCrate.
2021-07-13Rollup merge of #86887 - jyn514:cleanup-clean, r=CraftSpiderYuki Okushi-46/+1
rustdoc: remove dead code in `clean` Builds on https://github.com/rust-lang/rust/pull/86886 and should not be merged before.
2021-07-12Auto merge of #86841 - GuillaumeGomez:reexported-macro-2-render, r=Stupremeebors-54/+79
Fix rendering of reexported macros 2.0 and fix visibility of reexported items So, this PR grew a bit out of focus, it does the following things: * Fixes #86276. * Fixes visibility display for reexported items: it now takes the visibility of the "use" statement rather than the visibility of the reexported item itself). * Fixes the display of reexported items if "--document-private-items" option is used. Before, they were simply skipped. * Fixes inconsistency on typedef items: they didn't display their visibility contrary to other items. I added tests to check everything listed above. cc `@camelid` `@ollie27` (in case one of you want to review?) r? `@jyn514`
2021-07-08Rework SESSION_GLOBALS API to prevent overwriting itGuillaume Gomez-9/+9
2021-07-07Only show restricted pub useGuillaume Gomez-1/+2
2021-07-07Fix reexports visibilityGuillaume Gomez-32/+30
2021-07-07Unify macro source displayGuillaume Gomez-58/+48
2021-07-07Fix rendering of reexported macros 2.0Guillaume Gomez-9/+45
2021-07-06fix dead link for method in trait of blanket impl from third party crateFrançois Mockers-1/+1
2021-07-06Auto merge of #86644 - Stupremee:replace-fakedefids-with-itemid, r=jyn514bors-55/+45
rustdoc: Replace `FakeDefId` with new `ItemId` type Follow up from #84707 `@Manishearth` [suggested](https://github.com/rust-lang/rust/pull/84707#issuecomment-831994669) that there should be a new `ItemId` type that can distinguish between auto traits, normal ids, and blanket impls instead of using `FakeDefId`s. This type is introduced by this PR. There are still some `FIXME`s left, because I was unsure what the best solution for them would be. Especially the naming in general now is a bit weird right now and needs to be cleaned up. Now there are no "fake" ids so the `is_fake` method on `Item` does not really make sense and maybe the methods on `ItemId` should be renamed too? Also, we need to represent the new item ids in the JSON backend somehow.
2021-07-05rustdoc: Use `impl_id` and `for_` DefId's for Blanket item idJustus K-2/+2
2021-07-05rustdoc: Add `PrimitiveType` to `ItemId::Primitive`Justus K-6/+7
2021-07-05Revert "rustdoc: Store DefId's in ItemId on heap for decreasing Item's size"Justus K-24/+26
This reverts commit 41a345d4c46dad1a98c9993bc78513415994e8ba.
2021-07-05rustdoc: Store DefId's in ItemId on heap for decreasing Item's sizeJustus K-26/+24
2021-07-05rustdoc: Rename `expect_real` to `expect_def_id`, remove `Item::is_fake`Justus K-25/+18
2021-07-05rustdoc: Replace `FakeDefId` with new `ItemId` typeJustus K-43/+39
2021-07-05rustdoc: Remove unused Clean implsJoshua Nelson-46/+1
2021-07-05Remove `impl Clean for {Ident, Symbol}`Joshua Nelson-15/+1
These were only used once, in a place where it was trivial to replace. Also, it's unclear what 'clean' would mean for these, so it seems better to be explicit.
2021-07-05Auto merge of #86282 - camelid:macro_rules-matchers, r=jyn514bors-47/+39
Pretty-print macro matchers instead of using source code Fixes #86208.
2021-07-03Pretty-print macro matchers instead of using source codeNoah Lev-47/+39
The output is not quite as nice as it used to be, but it does work.
2021-07-01Rename all_crate_nums query to crates and remove useless wrapperbjorn3-1/+1
2021-06-26Auto merge of #86449 - Stupremee:render-self-cast-in-type-bound, ↵bors-3/+18
r=GuillaumeGomez rustdoc: Render `<Self as X>::Y` type casts properly across crate bounds My last PR that introduced the type casting did not work for cross-crate re-exported traits, which is fixed in this PR. Fully resolves #85454
2021-06-26Auto merge of #84814 - Stupremee:properly-render-hrtbs, r=GuillaumeGomezbors-80/+87
Properly render HRTBs ```rust pub fn test<T>() where for<'a> &'a T: Iterator, {} ``` This will now render properly including the `for<'a>` ![image](https://user-images.githubusercontent.com/39732259/116808426-fe6ce600-ab38-11eb-9452-f33f554fbb8e.png) I do not know if this covers all cases, it only covers everything that I could think of that includes `for` and lifetimes in where bounds. Also someone need to mentor me on how to add a proper rustdoc test for this. Resolves #78482
2021-06-26Rollup merge of #86513 - fee1-dead:cross-crate-doc-hidden, r=danielhenrymantillaYuki Okushi-1/+18
Rustdoc: Do not list impl when trait has doc(hidden) Fixes #86448.
2021-06-22Account for more casesDeadbeef-4/+4
2021-06-22Do not list impl when trait has doc(hidden)Deadbeef-1/+18
2021-06-19rustdoc: Introduce new `DynTrait` type for better representation of trait ↵Justus K-75/+45
objects
2021-06-18Resolve intra-doc links in summary descMichael Howell-0/+27
Before: ![rustdoc-intra-doc-link-summary-before](https://user-images.githubusercontent.com/1593513/122623069-9d995e80-d04f-11eb-8d46-ec2ec126bb5e.png) After: ![rustdoc-intra-doc-link-summary](https://user-images.githubusercontent.com/1593513/122623076-a4c06c80-d04f-11eb-967a-f5916871c34b.png)
2021-06-18rustdoc: Render `<Self as X>::Y` type casts properly across crate boundsJustus K-3/+18
2021-06-18rustdoc: Render `for<'_>` lifetimes in trait objectsJustus K-6/+19
2021-06-18rustdoc: Render `for<'_>` lifetimes in front of where boundJustus K-18/+42
2021-06-16Rollup merge of #86327 - GuillaumeGomez:safe-intrinsics, r=lqdYuki Okushi-1/+7
Don't mark "safe" intrinsics as unsafe A good example of this is [intrinsics::abort](https://doc.rust-lang.org/nightly/core/intrinsics/fn.abort.html). Before: ![Screenshot from 2021-06-15 14-58-42](https://user-images.githubusercontent.com/3050060/122056942-65ddad00-cdea-11eb-829e-5f5e258387de.png) After: ![Screenshot from 2021-06-15 14-59-22](https://user-images.githubusercontent.com/3050060/122056956-6aa26100-cdea-11eb-94d8-e18b4956cfa4.png) cc ``@jyn514`` r? ``@lqd``
2021-06-15Don't mark "safe" intrinsics as unsafeGuillaume Gomez-1/+7
2021-06-12dont ICE on `ConstEvaluatable` predicatesEllen-1/+1
2021-06-09Rollup merge of #85957 - BoxyUwU:rustdoc-const-generic-defaults, r=oli-obkYuki Okushi-4/+15
Display defaults on const params- rustdoc previously rustdoc would render this struct declaration: `pub struct Foo<const N: usize = 10>;` as: `pub struct Foo<const N: usize>;` this PR changes it to render correctly
2021-06-05Auto merge of #85990 - jyn514:channel-replace-rustdoc, r=Manishearthbors-1/+2
rustdoc: link consistently to stable/beta in diagnostic messages Builds on https://github.com/rust-lang/rust/pull/84942. This makes the diagnostics consistent with the links.
2021-06-05Auto merge of #85457 - jyn514:remove-doc-include, r=GuillaumeGomezbors-88/+5
Remove `doc(include)` This nightly feature is redundant now that `extended_key_value_attributes` is stable (https://github.com/rust-lang/rust/pull/83366). `@rust-lang/rustdoc` not sure if you think this needs FCP; there was already an FCP in #82539, but technically it was for deprecating, not removing the feature altogether. This should not be merged before #83366. cc `@petrochenkov`
2021-06-05Rollup merge of #84942 - jyn514:channel-replace, r=ManishearthYuki Okushi-1/+6
rustdoc: link to stable/beta docs consistently in documentation This is an alternative to https://github.com/rust-lang/rust/pull/84941 which fixes the problem consistently by linking to stable/beta for *all* items, not just for primitives. ## User-facing changes - Intra-doc links to primitives that currently go to rust-lang.org/nightly/std/primitive.x.html will start going to channel that rustdoc was built with. Nightly will continue going to /nightly; Beta will link to /beta; stable compilers will link to /1.52.1 (or whatever version they were built as). - Cross-crate links from std to core currently go to /nightly unconditionally. They will start going to /1.52.0 on stable channels (but remain the same on nightly channels). - Intra-crate links from std to std (or core to core) currently go to the same URL they are hosted at; they will continue to do so. Notably, this is different from everything else because it can preserve the distinction between /stable and /1.52.0 by using relative links. Note that "links" includes both intra-doc links and rustdoc's own automatically generated hyperlinks. ## Implementation changes - Update the testsuite to allow linking to /beta and /1.52.1 in docs - Use an html_root_url for the standard library that's dependent on the channel This avoids linking to nightly docs on stable. - Update rustdoc to use channel-dependent links for primitives from an unknown crate - Set DOC_RUST_LANG_ORG_CHANNEL from bootstrap to ensure it's in sync - Include doc.rust-lang.org in the channel cc Mark-Simulacrum - I know [you were dubious about this in the past](https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/Rustdoc.20unconditionally.20links.20to.20nightly.20libstd.20docs/near/231223124), but I'm not quite sure why? I see this as "just a bugfix", I don't know why rustdoc should unconditionally link to nightly. cc dtolnay who commented in https://github.com/rust-lang/rust/issues/30693: > I would welcome a PR to solve this permanently if anyone has ideas for how. I don't believe we need an RFC. Fixes https://github.com/rust-lang/rust/issues/30693 (note that issue is marked as feature-accepted, although I don't see where it was discussed).
2021-06-05Rollup merge of #84880 - jyn514:cleanup-itemkind, r=GuillaumeGomezYuki Okushi-20/+33
Make match in `register_res` easier to read - Don't duplicate DefKind -> ItemType handling; that's a good way to get bugs - Use exhaustive match - Add comments This found that register_res is very wrong in at least one way: if it registers a Res for `Variant`, it should also register one for `Field`. But I don't know whether the one for Variant should be removed or Field added. Maybe someone has ideas? Found while reviewing https://github.com/rust-lang/rust/pull/84176.
2021-06-05Rollup merge of #84466 - jyn514:prim-str, r=GuillaumeGomezYuki Okushi-35/+0
rustdoc: Remove `PrimitiveType::{to_url_str, as_str}` These can easily be rewritten in terms of `as_sym`, and this avoids bugs where the two get out of sync. I don't expect this to have a perf impact, but I'll start a perf run just in case.
2021-06-04rustdoc: link consistently to stable/beta in diagnostic messagesJoshua Nelson-1/+2
2021-06-04rustdoc: link to stable/beta docs consistently in documentationJoshua Nelson-1/+6
## User-facing changes - Intra-doc links to primitives that currently go to rust-lang.org/nightly/std/primitive.x.html will start going to channel that rustdoc was built with. Nightly will continue going to /nightly; Beta will link to /beta; stable compilers will link to /1.52.1 (or whatever version they were built as). - Cross-crate links from std to core currently go to /nightly unconditionally. They will start going to /1.52.0 on stable channels (but remain the same on nightly channels). - Intra-crate links from std to std (or core to core) currently go to the same URL they are hosted at; they will continue to do so. Notably, this is different from everything else because it can preserve the distinction between /stable and /1.52.0 by using relative links. Note that "links" includes both intra-doc links and rustdoc's own automatically generated hyperlinks. ## Implementation changes - Update the testsuite to allow linking to /beta and /1.52.1 in docs - Use an html_root_url for the standard library that's dependent on the channel This avoids linking to nightly docs on stable. - Update rustdoc to use channel-dependent links for primitives from an unknown crate - Set DOC_RUST_LANG_ORG_CHANNEL from bootstrap to ensure it's in sync - Include doc.rust-lang.org in the channel
2021-06-04Remove `doc(include)`Joshua Nelson-88/+5
2021-06-03rustdoc- Show defaults on const generics Ellen-4/+15
2021-06-03Auto merge of #84834 - GuillaumeGomez:sidebar-unification, r=jshabors-1/+0
Sidebar unification This PR does a few things: * Put crates list at all levels (before, it was only on the "top" items) * Fix bug in module sidebar: the list of items was from the parent module. The other changes (on bootstrap mostly) were to allow to generate multiple crates in a same folder so that we can ensure that clicking on the crates in the sidebar works as expected. I added a rustdoc-gui test to ensure everything is where it should be. r? `@jyn514`
2021-06-02Restrict access to crate_name.Camille GILLOT-1/+1
Also remove original_crate_name, which had the exact same implementation
2021-06-01Revert "Reduce the amount of untracked state in TyCtxt"Camille Gillot-1/+1
2021-05-31* Put crates list at all levelsGuillaume Gomez-1/+0
* Fix bug in module sidebar: the list of items was from the parent module
2021-05-30Restrict access to crate_name.Camille GILLOT-1/+1
Also remove original_crate_name, which had the exact same implementation
2021-05-20Remove `PrimitiveType::as_str`Joshua Nelson-31/+0