about summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2021-02-28Run some rustc passes in rustdocGuillaume Gomez-0/+2
2021-02-27Rollup merge of #82584 - tazjin:rustdoc-aria, r=GuillaumeGomezDylan DPC-1/+1
Add ARIA role to sidebar toggle in Rustdoc This indicates that the div is an interactive element, and makes the sidebar toggle "clickable" in assistive technologies. Example of Vimium after this change has been applied (see the issue mentioned below for a screenshot of before): ![Screenshot of Vimium link hints on a Rustdoc page, indicating that the sidebar toggle is clickable](https://user-images.githubusercontent.com/1552853/109384961-ff935400-78f8-11eb-8199-1d35181aeff0.png) Fixes #82582
2021-02-27Rollup merge of #82563 - lucas-deangelis:issue-82209-fix, r=jyn514Dylan DPC-0/+8
Fix intra-doc handling of `Self` in enum Fixes #82209
2021-02-27Remove the x86_64-rumprun-netbsd targetSimonas Kazlauskas-1/+0
Closes #81514
2021-02-27Teach rustdoc how to display WASI.Dan Gohman-0/+5
As a followup to [this comment] in #82420, this patch teaches rustdoc how to display WASI. [this comment]: https://github.com/rust-lang/rust/pull/82420#issuecomment-784523826
2021-02-27Add ARIA role to sidebar toggle in RustdocVincent Ambo-1/+1
This indicates that the div is an interactive element, and makes the sidebar toggle "clickable" in assistive technologies. Fixes #82582
2021-02-27Auto merge of #82511 - jsha:fix-bfcache2, r=GuillaumeGomezbors-6/+14
Fix back-forward cache in rustdoc frontend Rustdoc's frontend set a no-op unload handler, specifically to disable Firefox's back-forward cache because it caused a bug. It's nice to allow the back-forward cache because it permits faster navigations. This change addresses the issues that were caused by back-forward cache. https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/1.5/Using_Firefox_1.5_caching https://web.dev/bfcache/ Demo: https://jacob.hoffman-andrews.com/rust/fix-bfcache/std/string/struct.String.html Related: #72272
2021-02-26Update src/librustdoc/passes/collect_intra_doc_links.rsLucas De Angelis-1/+1
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2021-02-26Fix formattingLucas De Angelis-1/+6
2021-02-26Fix intra-doc handling of `Self` in enumLucas De Angelis-0/+3
Fixes #82209
2021-02-26Rollup merge of #82549 - rust-lang:revert-82313-update-normalize-css, r=apirainoGuillaume Gomez-1/+1
Revert "Update normalize.css to 8.0.1" Reverts rust-lang/rust#82313 Fixes #82548 Fixes #82542 ``@jsha:`` I'm reverting until we can come up with a new version which is fully working. r? ``@jyn514``
2021-02-26Rollup merge of #82545 - jsha:woff2, r=GuillaumeGomezGuillaume Gomez-2/+14
rustdoc: add optional woff2 versions of FiraSans. For browsers that support woff2 (most modern ones: https://caniuse.com/woff2), this offers a reduction in download size for these two fonts from 362k to 257k (32% reduction). It decreases the total page size for `struct.String.html` (counting all subresources) by about 2.5%. If this is interesting, I'm happy to apply the same treatment to the other fonts, but these two are the biggest.
2021-02-26Rollup merge of #81940 - jhpratt:stabilize-str_split_once, r=m-ou-seGuillaume Gomez-1/+0
Stabilize str_split_once Closes #74773
2021-02-26Revert "Update normalize.css to 8.0.1"Guillaume Gomez-1/+1
2021-02-26Embed woff2 files in rustdoc binary.Jacob Hoffman-Andrews-0/+8
2021-02-26Add optional woff2 versions of FiraSans.Jacob Hoffman-Andrews-2/+6
For browsers that support woff2 (most modern ones: https://caniuse.com/woff2), this offers a reduction in download size for these two fonts from 362k to 257k (32% reduction). It decreases the total page size for `struct.String.html` (counting all subresources) by about 2.5%. If this is interesting, I'm happy to apply the same treatment to the other fonts, but these two are the biggest.
2021-02-26Auto merge of #78429 - casey:doctest-attribute-splitting, r=jyn514bors-7/+71
[librustdoc] Only split lang string on `,`, ` `, and `\t` Split markdown lang strings into tokens on `,`. The previous behavior was to split lang strings into tokens on any character that wasn't a `_`, `_`, or alphanumeric. This is a potentially breaking change, so please scrutinize! See discussion in #78344. I noticed some test cases that made me wonder if there might have been some reason for the original behavior: ``` t("{.no_run .example}", false, true, Ignore::None, true, false, false, false, v(), None); t("{.sh .should_panic}", true, false, Ignore::None, false, false, false, false, v(), None); t("{.example .rust}", false, false, Ignore::None, true, false, false, false, v(), None); t("{.test_harness .rust}", false, false, Ignore::None, true, true, false, false, v(), None); ``` It seemed pretty peculiar to specifically test lang strings in braces, with all the tokens prefixed by `.`. I did some digging, and it looks like the test cases were added way back in [this commit from 2014](https://github.com/rust-lang/rust/commit/3fef7a74ca9a) by `@skade.` It looks like they were added just to make sure that the splitting was permissive, and aren't testing that those strings in particular are accepted. Closes https://github.com/rust-lang/rust/issues/78344.
2021-02-25Rollup merge of #82484 - bugadani:docfix, r=jyn514Aaron Hill-1/+11
rustdoc: Remove duplicate "List of all items" Closes #82477 r? `@jyn514`
2021-02-25Auto merge of #82517 - Dylan-DPC:rollup-a1958gb, r=Dylan-DPCbors-18/+23
Rollup of 16 pull requests Successful merges: - #75807 (Convert core/num/mod.rs to intra-doc links) - #80534 (Use #[doc = include_str!()] in std) - #80553 (Add an impl of Error on `Arc<impl Error>`.) - #81167 (Make ptr::write const) - #81575 (rustdoc: Name fields of `ResolutionFailure::WrongNamespace`) - #81713 (Account for associated consts in the "unstable assoc item name colission" lint) - #82078 (Make char and u8 methods const) - #82087 (Fix ICE caused by suggestion with no code substitutions) - #82090 (Do not consider using a semicolon inside of a different-crate macro) - #82213 (Slices for vecs) - #82214 (Remove redundant to_string calls) - #82220 (fix the false 'defined here' messages) - #82313 (Update normalize.css to 8.0.1) - #82321 (AST: Remove some unnecessary boxes) - #82364 (Improve error msgs when found type is deref of expected) - #82514 (Update Clippy) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-02-25Rollup merge of #82313 - jsha:update-normalize-css, r=GuillaumeGomezDylan DPC-1/+1
Update normalize.css to 8.0.1 From From https://github.com/necolas/normalize.css/releases/tag/8.0.1. The old version was 3.0.0, from 2014. The new version is from 2018. I noticed when looking at frontend performance for rustdoc that this file was out of date. The URL in the 3.0.0 license header now resolves to an incorrect destination. And generally it seems good to be up-to-date. Before-and-after images, plus diff, under details. TL;DR: Nothing changes except a slight adjustment to line height. <details> ![with-normalize-8 0 1](https://user-images.githubusercontent.com/220205/108581849-bd5c8800-72e4-11eb-9150-78c8d67ca37a.png) ![with-normalize-3 0 0](https://user-images.githubusercontent.com/220205/108581848-bcc3f180-72e4-11eb-8b45-0cd1415a51e5.png) ![diff](https://user-images.githubusercontent.com/220205/108581890-dfeea100-72e4-11eb-93c5-6284492f54a9.png) </details>
2021-02-25Rollup merge of #81575 - camelid:rustdoc-wrongnamespace-cleanup, r=jyn514Dylan DPC-17/+22
rustdoc: Name fields of `ResolutionFailure::WrongNamespace` It makes it clearer that the `Namespace` is the one requested by the disambiguator, rather than the actual namespace of the item. It said that in the docs before, but now you can tell in the code so it reduces the potential for confusion.
2021-02-25Auto merge of #82265 - GuillaumeGomez:cleanup-attrs-twice, r=jyn514bors-6/+23
Prevent to compute Item attributes twice I came across this case when working on another part of rustdoc. Not a game changer but a nice little improvement. cc `@camelid` r? `@jyn514`
2021-02-24Fix back-forward cache in rustdoc frontend.Jacob Hoffman-Andrews-6/+14
Rustdoc's frontend set a no-op unload handler, specifically to disable Firefox's back-forward cache because it caused a bug. It's nice to allow the back-forward cache because it permits faster navigations. This change addresses the issues that were caused by back-forward cache. https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/1.5/Using_Firefox_1.5_caching https://web.dev/bfcache/
2021-02-24Add testDániel Buga-0/+11
2021-02-24Remove duplicate stringDániel Buga-1/+0
2021-02-24Make DocContext &mut for cleanGuillaume Gomez-1/+1
2021-02-24Prevent to compute Item attributes twiceGuillaume Gomez-6/+23
2021-02-23rustdoc: Name fields of `ResolutionFailure::WrongNamespace`Camelid-17/+22
It makes it clearer that the `Namespace` is the one requested by the disambiguator, rather than the actual namespace of the item. It said that in the docs before, but now you can tell in the code so it reduces the potential for confusion.
2021-02-23Improve code readabilityGuillaume Gomez-11/+12
2021-02-23* Fix some typoGuillaume Gomez-10/+7
* Improve documentation * Add a test to ensure that spotlighted traits from dependencies are taken into account as expected
2021-02-23Put clean::Trait extra information into a new struct to make it more coherentGuillaume Gomez-18/+33
2021-02-23Use a qualified path to make it more clear where `list_contains_name` ↵Guillaume Gomez-2/+1
function comes from
2021-02-23Remove is_spotlight field from `Trait`Guillaume Gomez-20/+39
2021-02-23Rollup merge of #82305 - camelid:no-more-refcell, r=jyn514Dylan DPC-60/+56
Remove many RefCells from DocContext I left some of them so this change doesn't balloon in size and because removing the RefCell in `DocContext.resolver` would require compiler changes. Thanks to `@jyn514` for making this a lot easier with #82020! r? `@jyn514`
2021-02-23Fix nitsGuillaume Gomez-8/+4
2021-02-23Add --generate-redirect-map option to replace HTML redirection file with a ↵Guillaume Gomez-12/+60
unique JSON map
2021-02-23Rollup merge of #82234 - GuillaumeGomez:remove-query-param-on-esc, r=Nemo157Dylan DPC-1/+6
Remove query parameters when skipping search results Fixes #81330. This PR changes the following: when pressing ESC and that no other "action" was performed (understand: no closing the search result, or hiding a menu or something along the line), then we discard the URL query parameters (the `?whatever=dsjfs`). What do you think about this change ```@rust-lang/rustdoc``` ? EDIT: finally we're simply removing the query parameter when we're skipping the search results. r? ```@Nemo157```
2021-02-23Rollup merge of #79423 - camelid:smart-punct, r=jyn514Dylan DPC-6/+7
Enable smart punctuation Closes #76690.
2021-02-22Remove many RefCells from DocContextCamelid-60/+56
I left some of them so this change doesn't balloon in size and because removing the RefCell in `DocContext.resolver` would require compiler changes. Thanks to `@jyn514` for making this a lot easier with #82020!
2021-02-22Rollup merge of #82382 - camelid:remove-fake_def_ids-refcell, r=jyn514Yuki Okushi-6/+4
rustdoc: Remove `fake_def_ids` RefCell
2021-02-22Rollup merge of #82353 - camelid:no-more-param_env-cell, r=jyn514Yuki Okushi-9/+6
rustdoc: Remove unnecessary `Cell` around `param_env` r? `@jyn514`
2021-02-22Rollup merge of #82351 - notriddle:docs-meta-description, r=jyn514Yuki Okushi-1/+6
Use the first paragraph, instead of cookie-cutter text, for rustdoc descriptions Partially addresses #82283.
2021-02-21rustdoc: Remove `fake_def_ids` RefCellCamelid-6/+4
2021-02-22Auto merge of #82295 - jyn514:feature-gate, r=Manishearthbors-0/+3
[intra-doc links] Don't check feature gates of items re-exported across crates It should be never break another crate to re-export a public item. Note that this doesn't check the feature gate at *all* for other crates: - Feature-gates aren't currently serialized, so the only way to check the gate is with ad-hoc attribute checking. - Checking the feature gate twice (once when documenting the original crate and one when documenting the current crate) seems not great. This should still catch using the feature most of the time though, since people tend to document their own crates. Closes https://github.com/rust-lang/rust/issues/82284. r? `@Manishearth`
2021-02-20rustdoc: Remove unnecessary `Cell` around `param_env`Camelid-9/+6
2021-02-20Revert changes to all.htmlMichael Howell-6/+1
This code wasn't actually working, and trying to SEO optimize that page is pointless anyway.
2021-02-20Cut off plain text descriptions after headersMichael Howell-0/+2
Before: The Rust Standard LibraryThe Rust Standard Library is the foundation of portable Rust software, a set of minimal and battle-tested shared abstractions for the broader Rust ecosystem. It offers core types, like `Vec<T>` and `Option<T>`, library-defined operations on language primitives, standard macros, I/O and multithreading, among many other things. After: The Rust Standard Library
2021-02-20Use the first paragraph, instead of cookie-cutter text, for rustdoc descriptionsMichael Howell-2/+10
Fixes #82283
2021-02-20Don't render [src] link on dummy spansGuillaume Gomez-0/+7
2021-02-19Re-minify normalize.css.Jacob Hoffman-Andrews-349/+2
This bypasses tidy's complaints about tab indent. Also, this lets us remove comments while keeping the MIT license comment.