| Age | Commit message (Collapse) | Author | Lines |
|
r=jyn514
fix rustdoc stack overflow on mutually recursive Deref
fix #85095
fix #85037
|
|
Also factor out outer_version and const_outer_version into
render_rightside.
|
|
|
|
This covers rendering of stability_since and the srclink across methods
and trait implementations, so their DOM representation is consistent.
|
|
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.
|
|
|
|
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.
|
|
This makes it possible to use Ctrl-F to find methods defined in traits.
|
|
fix #85037
|
|
fix #85095
|
|
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```
|
|
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.
|
|
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.
|
|
(update: placated tidy)
(update: rebased post PR #84707 )
merge me
|
|
This allows for a more readable straight-through logic in render_impl
without need for a closure.
|
|
|
|
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`
|
|
|
|
|
|
|
|
|
|
Remove toggle for "undocumented items."
Per discussion in #84326. For trait implementations, this was
misleading: the items actually do have documentation (but it comes from
the trait definition).
For both trait implementations and trait implementors, this was
redundant: in both of those cases, the items are default-hidden by
different toggle at the level above.
Update tests: Remove XPath selectors that over-specified on details tag,
in cases that weren't testing toggles. Add an explicit test for toggles
on methods. Rename item-hide-threshold to toggle-item-contents for
consistency.
Demo:
https://hoffman-andrews.com/rust/untoggle-undocumented/std/string/struct.String.html
https://hoffman-andrews.com/rust/untoggle-undocumented/std/io/trait.Read.html
|
|
|
|
* Fix bug in module sidebar: the list of items was from the parent module
|
|
Per discussion in #84326. For trait implementations, this was
misleading: the items actually do have documentation (but it comes from
the trait definition).
For both trait implementations and trait implementors, this was
redundant: in both of those cases, the items are default-hidden by
different toggle at the level above.
Update tests: Remove XPath selectors that over-specified on details tag,
in cases that weren't testing toggles. Add an explicit test for toggles
on methods. Rename item-hide-threshold to toggle-item-contents for
consistency.
|
|
This flag isn't needed anymore. See #83784.
|
|
|
|
This sets their toggles to be closed in the HTML (matching the default
setting), and opens them if the setting indicates to do so.
This distinguishes between implementations and implementors based on
being descendants of certain named elements.
|
|
The makes the code for handling "auto-hide" settings more consistent.
|
|
Toggle-wrap items differently than top-doc.
This makes sure things like trait methods get wrapped at the
`<h3><code>` level rather than at the `.docblock` level. Also it ensures
that only the actual top documentation gets the `.top-doc` class.
Fixes #85167
Before:

https://doc.rust-lang.org/nightly/std/io/trait.Read.html#tymethod.read
After:

|
|
rustdoc: Call `initSidebarItems` in root module of crate
r? `@jsha`
Resolves #85301
|
|
|
|
|
|
This makes sure things like trait methods get wrapped at the
`<h3><code>` level rather than at the `.docblock` level. Also it ensures
that only the actual top documentation gets the `.top-doc` class.
|
|
|
|
|
|
More grammar
|
|
Migrate trait and impl blocks' toggles into
Part of #83332
After this, I think only the "global" doc comment will be used as JS toggle. Once this PR is merged, I check what remains and remove them.
There is one change that this PR brings:


As you can see, I had to move the "undocumented" items below, they're not mixed with the others anymore. Unfortunately, I don't see a way to keep the current appearance without JS. As a a reminder, currently it looks like this:


r? `@jsha`
|
|
|
|
|
|
It can be calculated on-demand.
|
|
The "aliases" attribute is not listed [on MDN], so it sounds like
it's rustdoc-specific. We don't want to conflict with any attributes
that are added to the spec in the future.
[on MDN]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements
|
|
Fix empty dom toggle
Currently, the empty impl blocks have toggles:

So when you expand it, nothing happens:

So now, in case the impl block is empty, we simply don't generate the details/summary wrapping (which also makes DOM lighter, yeay!):

r? `@jsha`
|
|
84304 - rustdoc: shrink Item::Attributes
Helps with https://github.com/rust-lang/rust/issues/84304
|
|
|
|
check item.is_fake() instead of self_id.is_some()
Remove empty branching in Attributes::from_ast
diverse small refacto after Josha review
cfg computation moved in merge_attrs
refacto use from_ast twice for coherence
take cfg out of Attributes and move it to Item
|
|
instead of opening them with JS
|
|
Clean up DOM strings
Follow-up of #84320.
r? ``@jsha``
|
|
rustdoc: Get rid of `clean::TypeKind`
It does exactly the same thing as ItemType.
|
|
|