| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Fix a crash when searching for an alias contained in the currently selected filter crate.
Also remove alias search results for crates that should be filtered out.
The test suite needed to be fixed to actually take into account the crate filtering and check that there are no results when none are expected.
|
|
Rollup of 5 pull requests
Successful merges:
- #72691 (Fix escape key handling)
- #72807 (Avoid setting wrong obligation cause span of associated type mismatch)
- #72812 (Miri tests: skip parts of test_char_range)
- #72829 (Clarify terms in doc comments)
- #72830 (Fix release notes for niche initialization change)
Failed merges:
r? @ghost
|
|
Fix escape key handling
Fixes #72647.
The problem was that you could have a timeout just after the moment you press "escape", putting back the results.
r? @kinnison
|
|
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.
|
|
|
|
|
|
Remove font-display settings
Since for the moment, the result isn't as expected since #72092 when not using docs locally, let's revert them.
r? @Dylan-DPC
|
|
JS cleanup
The goal here is just to improve the source code a bit. I recommend to review one commit at a time, otherwise it might not make much sense. :)
The biggest commit is the second one: to prevent to have "global" variables declared in `main.js` (and thus prevent name conflict or overwriting), I moved such code into anonymous functions.
r? @kinnison
cc @rust-lang/rustdoc
|
|
|
|
|
|
Clean up rustdoc source code
Fixes #70498.
r? @kinnison
cc @rust-lang/rustdoc
|
|
|
|
|
|
|
|
with other functions
|
|
Unblock font loading in rustdoc.css
rustdoc's font loading defaults to "auto", so browsers may block render.
But rustdoc's case prefers a faster TTI for scrolling, this means the
strictest font-display in use should be "swap". rustdoc's fonts do provide
notable legibility improvements but first-time users will have little trouble
reading without. This means "optional" is preferred.
The one exception is Source Serif Pro: it's a big difference for body text, so
"fallback" is preferred over "optional" to cause a (tiny) block.
This follows up on (but does not resolve) #20962, taking PageSpeed Insight's rec fairly directly. Supporting reading material: https://drafts.csswg.org/css-fonts-4/#font-display-desc
|
|
Fix anchor display when hovering impl
A little gif for the fixed behaviour:

r? @kinnison
|
|
GuillaumeGomez:fix-back-on-page-with-search-behaviour, r=kinnison
Fix going back in history to a search result page on firefox
This bug was actually firefox not re-running JS script when you go back in history. To trigger it on the current docs:
* Make a search
* Pick an element (which isn't on the same page as the current element!)
* Go back in history
Instead of having the search results, you'll see the normal doc page. You can find a small explanation about it [here](http://web.archive.org/web/20100428053932/http://www.firefoxanswer.com/firefox/672-firefoxanswer.html).
r? @kinnison
cc @ollie27
|
|
|
|
|
|
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
|
|
deterministic results
* Update Javascript to take this change into account
* Update CrateData::aliases field to take a reference instead (it allowed to remove a conversion loop)
|
|
|
|
|
|
Add strikethrough support to rustdoc
Implements uncontroversial part of #71183.
r? @GuillaumeGomez
|
|
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}
|
|
rustdoc's font loading defaults to "auto", so browsers may block render.
But rustdoc's case prefers a faster TTI for scrolling, this means the
strictest font-display in use should be "swap". rustdoc's fonts do provide
notable legibility improvements but first-time users will have little trouble
reading without. This means "optional" is preferred.
The one exception is Source Serif Pro: it's a big difference for body text, so
"fallback" is preferred over "optional" to cause a (tiny) block.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Rename methods section
Fixes https://github.com/rust-lang/rust/issues/70475.
It renames the section [methods](https://doc.rust-lang.org/nightly/std/string/struct.String.html#methods) into "Implementations". However, I didn't not update the title in the sidebar considering that it only lists methods under (even though I updated the link of the "methods" to make it point to the "implementations" section.
r? @kinnison
cc @rust-lang/rustdoc
|
|
|
|
|
|
|
|
|
|
|
|
Replace filter_map().next() calls with find_map()
These are semantically the same, but `find_map()` is more concise.
|
|
These are semantically the same, but `find_map()` is more concise.
|
|
These are changes that would be needed if we add `#[must_use]` to
`Option::map`, per #71484.
|
|
|
|
|