1
Fork 0
Commit graph

281 commits

Author SHA1 Message Date
Manish Goregaokar
b3af37ac7b
Rollup merge of #88810 - camelid:cleanup-pt1, r=jyn514
rustdoc: Cleanup `clean` part 1

Split out from #88379.

These commits are completely independent of each other, and each is a fairly
small change (the last few are new commits; they are not from #88379):

- Remove unnecessary `Cache.*_did` fields
- rustdoc: Get symbol for `TyParam` directly
- Create a valid `Res` in `external_path()`
- Remove unused `hir_id` parameter from `resolve_type`
- Fix redundant arguments in `external_path()`
- Remove unnecessary `is_trait` argument
- rustdoc: Cleanup a pattern match in `external_generic_args()`

r? ``@jyn514``
2021-09-12 03:44:58 -07:00
Noah Lev
df281ee57b Only take tcx when it's all that's needed 2021-09-11 11:24:53 -07:00
Noah Lev
44e6f2e90f Remove unnecessary Cache.*_did fields
They can be obtained by accessing the `TyCtxt` where they are needed.
2021-09-09 19:17:38 -07:00
Fabian Wolff
79adda930f Ignore automatically derived impls of Clone and Debug in dead code analysis 2021-09-09 19:49:07 +02:00
bors
767edcf616 Auto merge of #88490 - GuillaumeGomez:associated-types-implementors-display, r=camelid,Manishearth
Display associated types of implementors

Fixes #86631.

Contrary to before, it doesn't display methods. I also had to "resurrect" the `auto-hide-trait-implementations` setting. :3

Only question at this point: should I move the `render_impl` boolean arguments into one struct? We're starting to have quite a lot of them...

cc `@cynecx`
r? `@camelid`
2021-09-01 21:31:16 +00:00
Guillaume Gomez
92dae39b64 Remove implementors setting 2021-09-01 20:34:51 +02:00
Guillaume Gomez
fba4149bf1 Clean render_impl arguments 2021-09-01 11:02:46 +02:00
Noah Lev
87e39ac1ec Remove bolding on associated constants
Associated types don't get bolded, so it looks off to have one kind
bolded and one not.
2021-08-31 09:53:21 -07:00
Guillaume Gomez
eb91366433 Put back "auto-collapse-implementors" setting 2021-08-30 16:21:23 +02:00
Guillaume Gomez
8553c199e7 Put back display of associated items (types and consts) 2021-08-30 16:21:23 +02:00
Joshua Nelson
90ac1ab26a Move Cache from Context to SharedContext 2021-08-22 03:38:04 +00:00
Guillaume Gomez
dfe4fec783 Remove LightSpan and use Span directly 2021-08-05 23:08:29 +02:00
Guillaume Gomez
e8869cb7a7 Wrap the span_map tuple index into a type called "LightSpan" 2021-08-05 23:08:28 +02:00
Guillaume Gomez
023231a709 Add links on source types to go to definition 2021-08-05 23:08:27 +02:00
Yuki Okushi
014e22c836
Rollup merge of #87451 - GuillaumeGomez:tuple-struct-field-doc, r=jyn514
Add support for tuple struct field documentation

Fixes  #42615.
This is #80320 updated to new codebase and with added tests.
Part of https://github.com/rust-lang/rust/issues/83255.

cc ```@camelid``` (since you were involved on the original PR).
r? ```@jyn514```
2021-07-29 06:11:45 +09:00
bors
76a3b609d0 Rustdoc accessibility: use real headers for doc items
Part of #87059

Partially reverts #84703

Preview at: https://notriddle.com/notriddle-rustdoc-test/real-headers/std/index.html
2021-07-25 21:41:57 +00:00
Guillaume Gomez
ec76b6eedd Add support for tuple structs' fields documentation 2021-07-25 21:19:21 +02:00
Michael Howell
30d49a401a Rustdoc accessibility: make the sidebar headers actual headers
Part of #87059

Preview it at: https://notriddle.com/notriddle-rustdoc-test/rustdoc-sidebar-header/std/index.html
2021-07-17 11:32:36 -07:00
bors
a6470c7fa8 Auto merge of #86662 - mockersf:fix-86620-link-unknown-location, r=jyn514
fix dead link for method in trait of blanket impl from third party crate

fix #86620

* changes `href` method to raise the actual error it had instead of an `Option`
* set the href link correctly in case of an error

I did not manage to make a small reproducer, I think it happens in a situation where
* crate A expose a trait with a blanket impl
* crate B use the trait from crate A
* crate C use types from crate B
* building docs for crate C without dependencies

r? `@jyn514`
2021-07-16 06:44:10 +00:00
François Mockers
c6ae96de96 comment about link without a href 2021-07-11 02:18:21 +02:00
Guillaume Gomez
1f84bffdf0 Fix display of small-section-header elements 2021-07-08 17:49:06 +02:00
François Mockers
a75e6292c5 only remove link for TyMethod 2021-07-06 22:30:14 +02:00
François Mockers
afb5b2150a review - better error names/doc 2021-07-06 22:13:08 +02:00
François Mockers
53447d81d0 fix dead link for method in trait of blanket impl from third party crate 2021-07-06 22:13:03 +02:00
Justus K
97c82d8731
Revert "rustdoc: Store DefId's in ItemId on heap for decreasing Item's size"
This reverts commit 41a345d4c46dad1a98c9993bc78513415994e8ba.
2021-07-05 19:51:54 +02:00
Justus K
45d3daece3
rustdoc: Store DefId's in ItemId on heap for decreasing Item's size 2021-07-05 19:51:51 +02:00
Justus K
acd4dc2d0c
rustdoc: Rename expect_real to expect_def_id, remove Item::is_fake 2021-07-05 19:49:48 +02:00
Justus K
43e1cdbaf9
rustdoc: Replace FakeDefId with new ItemId type 2021-07-05 19:49:43 +02:00
Michael Howell
cedd2425b6 fix(rustdoc): generics search
This commit adds a test case for generics, re-adds generics data
to the search index, and tweaks function indexing to use less space in JSON.

This reverts commit 14ca89446c.
2021-07-01 06:40:27 -07:00
Yuki Okushi
daa87adc4e
Rollup merge of #86608 - notriddle:notriddle/cleanup-rustdoc, r=jyn514
chore(rustdoc): remove unused members of RenderType

PR #86561 removes the only place the `generics` member is read. This PR does even more cleanup.
2021-06-26 00:42:13 +09:00
Michael Howell
14ca89446c chore(rustdoc): remove unused members of RenderType
Commit e629381653 removes the only place
these members variables are actually read.
2021-06-24 16:37:03 -07:00
Stefan Schindler
94c84bd72a Migrate from custom elements to divs with classes to be compatible with safari 2021-06-24 16:46:15 +02:00
Stefan Schindler
cc9ef7d8a8 Hide Crate Version on narrow Screens 2021-06-24 16:46:15 +02:00
Yuki Okushi
2322097ef4
Rollup merge of #86561 - notriddle:notriddle/cleanup-rustdoc, r=jyn514
chore(rustdoc): Remove unused impl block
2021-06-24 13:47:38 +09:00
Jacob Hoffman-Andrews
093e246445 Revert "List trait impls before methods from deref in the sidebar of Rustdoc's output"
This reverts commit 8a058926ec.
2021-06-22 18:18:54 -07:00
Michael Howell
e629381653 chore(rustdoc): Remove unused impl block 2021-06-22 16:41:34 -07:00
Deadbeef
5fb27bca6c
Check for const_unstable before printing const 2021-06-21 19:06:21 +08:00
Deadbeef
9c495b30ef
"(const: unstable)" for stable-but-const-unstable 2021-06-20 08:13:23 +08:00
bors
966361fe49 Auto merge of #86322 - trinity-1686a:rustdoc-fix-overflow-recursive-deref, r=jyn514
fix rustdoc stack overflow on mutually recursive Deref

fix #85095
fix #85037
2021-06-18 07:49:41 +00:00
Jacob Hoffman-Andrews
2ac5c1721a Fix target highlighting in rustdoc.
Also factor out outer_version and const_outer_version into
render_rightside.
2021-06-16 22:48:23 -07:00
Jacob Hoffman-Andrews
c4fa6d5827 Move anchor earlier in the DOM for easier layout 2021-06-16 22:47:46 -07:00
Jacob Hoffman-Andrews
5de1391b88 Factor out render_rightside
This covers rendering of stability_since and the srclink across methods
and trait implementations, so their DOM representation is consistent.
2021-06-16 22:46:53 -07:00
Jacob Hoffman-Andrews
593d6d1cb1 Make portability part of the summary.
That means it will be visible under "Implementors" on trait pages, and
under "Implementations" on struct/enum pages, even when all methods are
collapsed.

Switch to a float layout for rightside elements.
2021-06-16 22:20:25 -07:00
Jacob Hoffman-Andrews
bff4f073c8 Use render_impl_summary when rendering traits. 2021-06-16 22:08:44 -07:00
Jacob Hoffman-Andrews
ce6472987d Remove methods under Implementors on trait pages
These were hidden by default, and duplicated information already on the
page anyhow.

Also remove the "Auto-hide trait implementors of a trait" setting,
which is not needed anymore.
2021-06-16 22:08:36 -07:00
Jacob Hoffman-Andrews
62658bfc22 Open trait implementations' toggles by default.
This makes it possible to use Ctrl-F to find methods defined in traits.
2021-06-16 10:24:59 -07:00
Trinity Pointard
2d76d44eae remove code for recursive Deref in sidebar
fix #85037
2021-06-15 14:30:14 +02:00
Trinity Pointard
aee50f417f fix rustdoc stack overflow on mutually recursive Deref
fix #85095
2021-06-15 11:47:17 +02:00
Yuki Okushi
d921055a5e
Rollup merge of #86277 - jsha:remove-must-use, r=Manishearth
Remove must_use from ALLOWED_ATTRIBUTES

This is a fairly common attribute on methods, but is not something you need to know when reading the method docs - the purpose of the attribute is for the compiler to tell you about it if you forget to use a value.

Removing reclaims some valuable space in the summary of methods, particularly when the attribute has a long string value.

As discussed in #84309. Partially addresses #81482.

r? ```@Manishearth```
2021-06-15 17:40:12 +09:00
bors
d74b36ea2f Auto merge of #84867 - pnkfelix:rustdoc-revert-deref-recur, r=jyn514
rustdoc: revert deref recur to resume inclusion of impl ExtTrait<Local> for ExtType

As discussed here: https://github.com/rust-lang/rust/issues/82465#issuecomment-829290384, Revert PR #80653 to resolve issue #82465.

Issue #82465 was we had stopped including certain trait implementations, namely implementations on an imported type of an imported trait *instantiated on a local type*. That bug was injected by PR #80653.

Reverting #80653 means we don't list all the methods that you have accessible via recursively applying `Deref`.

[Discussion in last week's rustc triage meeting](https://zulip-archive.rust-lang.org/238009tcompilermeetings/19557weekly2021042954818.html#236680594) led us to conclude that the bug was worse than the enhancement, and there was not an obvious fix for the bug itself. So for the short term we  remove the enhancement, while in the long term we will work on figuring out a way to have our imported trait implementation cake and eat it too.
2021-06-15 00:13:53 +00:00