| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
This should not be a change in behavior.
|
|
r=Mark-Simulacrum
Do not render unstable items for rustc doc
See the zulip conversion: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/rustc.20doc.3A.20.22internal.20compiler.20API.22.20warns.20are.20everywhere!/near/203850782
Before:

After:

Nothing changes in unstable items of std:
Before:

After:

Closes #54682
|
|
Reintroduce spotlight / "important traits" feature
(Reopened version of https://github.com/rust-lang/rust/pull/74111 because Github is broken, see discussion there)
Fixes https://github.com/rust-lang/rust/issues/73785
This PR reintroduces the "spotlight" ("important traits") feature.
A couple changes have been made:
As there were concerns about its visibility, it has been moved to be next to the return type, as opposed to being on the side.
It also no longer produces a modal, it shows the traits on hover, and it can be clicked on to pin the hover bubble.


It also works fine on mobile:

|
|
rustdoc: Rename internal API fns to `into_string`
to avoid surprising listed in API guidelines.
|
|
rustdoc: glue tokens before highlighting
Fixes #72684.
This commit also modifies the signature of `Classifier::new` to avoid
copying the source being highlighted.
|
|
This makes the spotlight show on hover instead of click. Clicks can be
used to persist it, which is also what's used on mobile.
|
|
|
|
This reverts commit 1244ced9580b942926afc06815e0691cf3f4a846.
|
|
r=Manishearth
Add option to collapse automatically implementors
Fixes #73403
It adds an option (enabled by default) which collapses all implementors impl blocks.
r? @kinnison
cc @rust-lang/rustdoc
|
|
|
|
to avoid surprising listed in API guidelines.
|
|
As rustc is permanently unstable. So marking every items
with unstable is essential useless.
|
|
Fixes #72684.
This commit also modifies the signature of `Classifier::new` to avoid
copying the source being highlighted.
|
|
Add Ayu theme to rustdoc
This is a port of a theme I maintain (https://github.com/Cldfire/ayu-rs) to the native rustdoc theme system. [Ayu](https://github.com/dempfi/ayu) (dark) is a richly-colored dark theme that many people enjoy using across a wide variety of environments.
Corresponds to the Ayu theme in [mdBook](https://github.com/rust-lang/mdBook).
Some screenshots:





Note that this pull request also makes some small code changes to allow for disabling theme stylesheets, preventing the rules from all the different themes from conflicting with one another. The only stylesheet that is not disabled is `light.css`; the theming system (quite hackily) switches themes by changing the href on this stylesheet and so permanently disabling all the others works perfectly fine.
|
|
|
|
Disable all themes other than `light.css` to prevent rule conflicts
|
|
|
|
Other terms are more inclusive and precise.
|
|
|
|
Hide `&mut self` methods from Deref in sidebar if there are no `DerefMut` impl for the type.
This partially addresses #74083.
|
|
If there are no `DerefMut` impl for the type.
|
|
|
|
|
|
- Pass around document_private a lot more
- Add tests
+ Add tests for intra-doc links to private items
+ Add ignored tests for warnings in reference links
|
|
|
|
r=eddyb
Track devirtualized filenames
Split payload of FileName::Real to track both real and virtualized paths.
(Such splits arise from metadata refs into libstd; the virtualized paths look like `/rustc/1.45.0/src/libstd/io/cursor.rs` rather than `/Users/felixklock/Dev/Mozilla/rust.git/src/libstd/io/cursor.rs`)
This way, we can emit the virtual name into things like the like the StableSourceFileId (as was done back before PR #70642) that ends up in incremental build artifacts, while still using the devirtualized file path when we want to access the file.
Fix #70924
|
|
Sort sidebar elements
r? @kinnison
|
|
Such splits arise from metadata refs into libstd.
This way, we can (in a follow on commit) continue to emit the virtual name into
things like the like the StableSourceFileId that ends up in incremetnal build
artifacts, while still using the devirtualized file path when we want to access
the file.
Note that this commit is intended to be a refactoring; the actual fix to the bug
in question is in a follow-on commit.
|
|
|
|
Clean up rustdoc source code
Fixes #70498.
r? @kinnison
cc @rust-lang/rustdoc
|
|
Doc alias improvements
After [this message](https://github.com/rust-lang/rust/issues/50146#issuecomment-496601755), I realized that the **doc alias**. So this PR does the followings:
* Align the alias discovery on items added into the search-index. It brings a few nice advantages:
* Instead of cloning the data between the two (in rustdoc source code), we now have the search-index one and aliases which reference to the first one. So we go from one big map containing a lot of duplicated data to just integers...
* In the front-end (main.js), I improved the code around aliases to allow them to go through the same transformation as other items when we show the search results.
* Improve the search tester in order to perform multiple requests into one file (I think it's better in this case than having a file for each case considering how many there are...)
* I also had to add the new function inside the tester (`handleAliases`)
Once this PR is merged, I intend to finally stabilize this feature.
r? @ollie27
cc @rust-lang/rustdoc
|
|
|
|
Fix clippy warnings
Fixes clippy::{cone_on_copy, filter_next, redundant_closure, single_char_pattern, len_zero,redundant_field_names, useless_format, identity_conversion, map_clone, into_iter_on_ref, needless_return, option_as_ref_deref, unused_unit, unnecessary_mut_passed}
r? @Dylan-DPC
|
|
Deprecated emoji
Fixes #67872.
r? @kinnison
cc @rust-lang/rustdoc
|
|
Fixes clippy::{cone_on_copy, filter_next, redundant_closure, single_char_pattern, len_zero,redundant_field_names, useless_format, identity_conversion, map_clone, into_iter_on_ref, needless_return, option_as_ref_deref, unused_unit, unnecessary_mut_passed}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
These are semantically the same, but `find_map()` is more concise.
|
|
|
|
Local items defined in external macros shouldn't generate rendered source files and should link to the external crate's docs instead.
|
|
use is_empty() instead of len comparison (clippy::len_zero)
use if let instead of while let loop that never loops (clippy::never_loop)
remove redundant returns (clippy::needless_return)
remove redundant closures (clippy::redundant_closure)
use if let instead of match and wildcard pattern (clippy::single_match)
don't repeat field names redundantly (clippy::redundant_field_names)
|
|
|
|
|