| Age | Commit message (Collapse) | Author | Lines |
|
Added a `rustdoc` shortcut for collapse/expand all
Now when the user presses the "+" key all sections will collapse/expand.
Also added a note to the help screen which describes this behavior.
This required increasing the height of the help screen.
|
|
rustdoc: Add doc snippets for trait impls, with a read more link
The read more link only appears if the documentation is more than one line long.

It currently does not appear on non-defaulted methods, since you can document them directly. I could make it so that default documentation gets forwarded if regular docs don't exist.
Fixes #33672
r? @alexcrichton
cc @steveklabnik
|
|
Now when the user presses the "+" key all sections will collapse/expand.
Also added a note to the help screen which describes this behavior.
|
|
|
|
rustdoc: Make the #[stable(since)] version attribute clearer with a tooltip
Rustdoc's new 'since' version placement only shows the version number in which the item was marked stable. This gains space but might make the meaning of this version string less clear in the docs, so I tried to bring some explicitness in a tooltip.
|
|
|
|
|
|
|
|
Fixes #33672
|
|
Fix selected item background style
r? @steveklabnik
|
|
|
|
Remove ExplicitSelf from HIR
`self` argument is already kept in the argument list and can be retrieved from there if necessary, so there's no need for the duplication.
The same changes can be applied to AST, I'll make them in the next breaking batch.
The first commit also improves parsing of method declarations and fixes https://github.com/rust-lang/rust/issues/33413.
r? @eddyb
|
|
|
|
|
|
|
|
rustdoc: fix emitting duplicate implementors in .js files
The collect() fn checks for double quotes; use them here as well.
Fixes: #30219
|
|
Update CSS for future rustdoc merge
cc #33382
r? @steveklabnik
cc @Manishearth
cc @birkenfeld
|
|
The collect() fn checks for double quotes; use them here as well.
Fixes: #30219
|
|
Warn unused trait imports, rebased
Rebase of #30021.
Fix #25730.
|
|
rustdoc: add "src" links to individual impls
Since these impls can be scattered around quite a bit, it is nice to be able to jump to the location where individual methods and trait impls are defined.
NOTE: this needs an update to the CSS, which I'd like to leave for whoever is the "rustdoc frontend champion". The new [src] links are currently too large and bold. Also, the interaction with the "since version X" annotations is not good.
Fixes: #30416
|
|
rustdoc: refactor rustdoc syntax highlighting for a more flexible API
Clients can now use the rustdoc syntax highlighter to classify tokens, then use that info to put together there own HTML (or whatever), rather than just having static HTML output.
|
|
Since these impls can be scattered around quite a bit, it is nice
to be able to jump to the location where individual methods and
trait impls are defined.
Fixes: #30416
|
|
|
|
|
|
Clients can now use the rustdoc syntax highlighter to classify tokens, then use that info to put together there own HTML (or whatever), rather than just having static HTML output.
|
|
Especially in cases like the one in the test file, this can blow
up the docs big time if string constants in the code contain HTML.
But also other constants can contain special chars (e.g. `&` as an
operator in constant expressions).
|
|
|
|
rustdoc: Cleanup ABI rendering
Use a common method for rendering `extern "<abi>"`.
This now consistently shows `extern fn` rather than `extern "C" fn`.
|
|
Make some fatal lexer errors recoverable
I've kept the changes to a minimum since I'm not really sure if this approach is a acceptable.
fixes #12834
cc @nrc
|
|
|
|
|
|
rustdoc: Handle concurrent mkdir requests
It's likely that `rustdoc` as a tool is run concurrently in the same output
(e.g. documenting multiple crates as Cargo does), in which case it needs to
handle concurrent calls to `fs::create_dir`.
|
|
rustdoc: Linkify extern crates
fixes #33178
r? @alexcrichton
|
|
rustdoc: Improve accessibility of rustdoc pages
fixes #33131
r? @alexcrichton
|
|
show unstable status for deprecated items
Fixes #32374.
|
|
rustdoc: inline all the impls
This used to be done to avoid inlining impls referencing private items, but is now unnecessary since we actually check that impls do not reference non-doc-reachable items.
fixes #32881
fixes #33025
fixes #33113
r? @alexcrichton
|
|
|
|
|
|
It's likely that `rustdoc` as a tool is run concurrently in the same output
(e.g. documenting multiple crates as Cargo does), in which case it needs to
handle concurrent calls to `fs::create_dir`.
|
|
An item is inlined and recorded as inlined even if it is
`doc(hidden)`, leading to unchecked external links.
|
|
|
|
|
|
Due to inlining it is possible to visit the same module multiple times
during `<Cache as DocFolder>::fold_crate`, so we keep track of the
modules we've already visited.
|
|
Use a common method for rendering `extern "<abi>"`.
This now consistently shows `extern "C" fn` rather than just `extern fn`.
|
|
rustdoc: refine cross-crate impl inlining
This changes the current rule that impls within `doc(hidden)` modules aren't inlined, to only inlining impls where the implemented trait and type are reachable in documentation.
fixes #14586
fixes #31948
.. and also applies the reachability checking to cross-crate links.
fixes #28480
r? @alexcrichton
|
|
rustdoc: Disambiguate anchors
Closes https://github.com/rust-lang/rust/issues/32890
|
|
Avoid linking to itself in implementors section of trait page
Fix #32474.
|
|
|
|
|
|
This changes the current rule that impls within `doc(hidden)` modules
aren't inlined, to only inlining impls where the implemented
trait and type are reachable in documentation.
|