about summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2022-05-05Rollup merge of #96635 - GuillaumeGomez:js-script-mode, r=notriddleMatthias Krüger-5/+15
Use "strict" mode in JS scripts Part of #93058. r? `@notriddle`
2022-05-05Add rotation animation on settings button when loadingGuillaume Gomez-1/+14
2022-05-05Use "strict" mode in JS scriptsGuillaume Gomez-5/+15
2022-05-05Auto merge of #96630 - m-ysk:fix/issue-88038, r=notriddlebors-11/+1
Include nonexported macro_rules! macros in the doctest target Fixes #88038 This PR aims to include nonexported `macro_rules!` macros in the doctest target. For more details, please see the above issue.
2022-05-05Rollup merge of #96658 - Folyd:es6, r=GuillaumeGomezYuki Okushi-112/+109
Move callback to the () => {} syntax. Part of https://github.com/rust-lang/rust/issues/93058. r? `@GuillaumeGomez`
2022-05-04rustdoc-json: Fix HRTBs for WherePredicate::BoundPredicateMartin Nordholts-2/+8
2022-05-04Stabilize `bool::then_some`Josh Triplett-1/+0
2022-05-04Auto merge of #96447 - petrochenkov:docregr, r=GuillaumeGomezbors-1/+13
rustdoc: Resolve doc links on fields during early resolution Another subset of https://github.com/rust-lang/rust/pull/94857 which fixes https://github.com/rust-lang/rust/issues/96429. This case regressed in https://github.com/rust-lang/rust/pull/96135 when `may_have_doc_links`-based filtering was introduced. Before that filtering structs could collect traits in scope for their fields, but after the filtering structs won't collect anything if they don't have doc comments on them, so we have to visit fields too.
2022-05-04Move callback to the () => {} syntax.Folyd-112/+109
Fix lint Fix main.js Restore anonymous functions Fix Fix more
2022-05-04ignore the doctest for mapYoshiki Matsuda-1/+1
2022-05-03Rollup merge of #93097 - GuillaumeGomez:settings-js, r=jshaYuki Okushi-197/+354
Switch settings menu to full js Since the settings can only be set when the JS is enabled, it's not really a problem. It also fixes a debate we had around the themes not being accessible easily before. ![Screenshot from 2022-01-19 23-06-59](https://user-images.githubusercontent.com/3050060/150221936-fd1a1e76-06b6-4416-a653-dbae111979ed.png) You can test it [here](https://rustdoc.crud.net/imperio/settings-js/doc/foo/index.html). r? ``@jsha``
2022-05-02Auto merge of #96431 - petrochenkov:parent, r=cjgillotbors-24/+18
rustc: Panic by default in `DefIdTree::parent` Only crate root def-ids don't have a parent, and in majority of cases the argument of `DefIdTree::parent` cannot be a crate root. So we now panic by default in `parent` and introduce a new non-panicing function `opt_parent` for cases where the argument can be a crate root. Same applies to `local_parent`/`opt_local_parent`.
2022-05-02Fix regression in link-to-definition introduced in #93803Guillaume Gomez-2/+12
2022-05-02remove the special case for nonexported macro_rules! macrosYoshiki Matsuda-10/+0
2022-05-02rustc: Panic by default in `DefIdTree::parent`Vadim Petrochenkov-24/+18
Only crate root def-ids don't have a parent, and in majority of cases the argument of `DefIdTree::parent` cannot be a crate root. So we now panic by default in `parent` and introduce a new non-panicing function `opt_parent` for cases where the argument can be a crate root. Same applies to `local_parent`/`opt_local_parent`.
2022-05-01* Add documentation for settings page rendering functions.Guillaume Gomez-55/+65
* Improve code. * Fix some documentation argument types. * Make settings order the same as before this PR. * Change timeout to 0 so that browser will render it as fast as possible.
2022-05-01rustdoc: Track `macro_rules` scopes during early doc link resolutionVadim Petrochenkov-1/+22
This way links referring to `macro_rules` items are resolved correctly
2022-04-30rustdoc: Keep full `ParentScope` during early doc link resolutionVadim Petrochenkov-19/+30
2022-04-30rustdoc: Early-resolve doc links in all requested namespacesVadim Petrochenkov-13/+37
2022-04-30Store all generic bounds as where predicates.Camille GILLOT-53/+79
2022-04-30Inline WhereClause into Generics.Camille GILLOT-1/+1
2022-04-30Move settings into full JSGuillaume Gomez-196/+343
2022-04-29Rollup merge of #96536 - rust-lang:notriddle/deref-slice-core, r=GuillaumeGomezDylan DPC-38/+50
rustdoc: fix missing method list for primitive deref target This change makes it so that local impls count when listing primitives that need retained. Fixes #95325
2022-04-29Rollup merge of #96390 - GuillaumeGomez:es6-part2, r=notriddleDylan DPC-245/+233
Switch JS code to ES6 - part 2 Part of #93058. It's based on https://github.com/rust-lang/rust/pull/96361 so it needs to wait for it to be merged first. r? `@notriddle`
2022-04-29rustdoc: show implementations on `#[fundamental]` wrappersMichael Howell-1/+10
Fixes #92940
2022-04-29rustdoc: prevent B -> C -> B -> C loops from stack overflowingMichael Howell-3/+12
2022-04-28rustdoc: fix missing method list for primitive deref targetMichael Howell-35/+38
This change makes it so that local impls count when listing primitives that need retained.
2022-04-28rustc_ast: Harmonize delimiter naming with `proc_macro::Delimiter`Vadim Petrochenkov-6/+6
2022-04-28Auto merge of #96085 - jsgf:deny-unused-deps, r=compiler-errorsbors-4/+6
Make sure `-Dunused-crate-dependencies --json unused-externs` makes rustc exit with error status This PR: - fixes compiletest to understand unused extern notifications - adds tests for `--json unused-externs` - makes sure that deny-level unused externs notifications are treated as compile errors - refactors the `emit_unused_externs` callstack to plumb through the level as an enum as a string, and adds `Level::is_error` Update: adds `--json unused-externs-silent` with the original behaviour since Cargo needs it. Should address `@est31's` concerns. Fixes: https://github.com/rust-lang/rust/issues/96068
2022-04-28Rollup merge of #96471 - BoxyUwU:let_else_considered_harmful, r=lcnrDylan DPC-1/+1
replace let else with `?` r? `@oli-obk`
2022-04-27Add --json unused-externs-silent with original behaviourJeremy Fitzhardinge-4/+6
Since Cargo wants to do its own fatal error handling for unused dependencies, add the option `--json unused-externs-silent` which has the original behaviour of not indicating non-zero exit status for `deny`/`forbid`-level unused dependencies.
2022-04-27tut tut tutEllen-1/+1
2022-04-27Rollup merge of #96430 - GuillaumeGomez:search-exclamation, r=notriddleDylan DPC-2/+13
Fix handling of `!` in rustdoc search Fixes #96399. I also updated the eBNF. cc `@jsha` r? `@notriddle`
2022-04-27Rollup merge of #96410 - notriddle:notriddle/issue-95873, r=GuillaumeGomezDylan DPC-1/+2
rustdoc: do not write `{{root}}` in `pub use ::foo` docs Fixes #95873
2022-04-26Remove dead code in main.jsGuillaume Gomez-23/+0
2022-04-26Migrate scrape-examples.js to ES6Guillaume Gomez-21/+24
2022-04-26Migrate storage.js to ES6Guillaume Gomez-22/+25
2022-04-26Migrate source-script to ES6Guillaume Gomez-44/+45
2022-04-26Migrate main.js to ES6Guillaume Gomez-128/+130
2022-04-26Migrate externs.js to ES6Guillaume Gomez-7/+10
2022-04-26Small JS code improvementsGuillaume Gomez-6/+5
2022-04-26Update rustdoc search parser to handle `!` correctlyGuillaume Gomez-2/+13
2022-04-26rustdoc: Resolve doc links on fields during early resolutionVadim Petrochenkov-1/+13
2022-04-26Rollup merge of #96361 - GuillaumeGomez:es6, r=notriddleGuillaume Gomez-224/+216
Switch JS code to ES6 Considering it's already quite big, I'll do the remaining files in another PR. Part of #93058. r? ``@notriddle``
2022-04-26Rollup merge of #96279 - GuillaumeGomez:remove-woff-fonts, r=camelid,jshaDylan DPC-85/+30
rustdoc: Remove .woff font files Copying `@jsha's` great comment: > Right now we ship 1.5MB of woff files in the rustdoc binary, and 1MB of woff2 files, for a total of 2.5MB. > > Per: > > https://caniuse.com/woff > https://caniuse.com/woff2 > > The only listed browser that supports woff and not woff2 is IE, which is not supported per https://github.com/rust-lang/rfcs/blob/master/text/1985-tiered-browser-support.md. > > I propose we stop shipping woff files and save 1.5MB from the rustdoc binary (and from each doc build). r? `@jsha`
2022-04-25rustdoc: do not write `{{root}}` in `pub use ::foo` docsMichael Howell-1/+2
2022-04-24Update settings.js to ES6Guillaume Gomez-6/+9
2022-04-24Update search.js to ES6Guillaume Gomez-218/+207
2022-04-22Auto merge of #96301 - notriddle:notriddle/synthetic-impl-prim, r=GuillaumeGomezbors-4/+9
rustdoc: make primitive synthetic impls for correct doc module This improves the accuracy of libcore primitive docs, which was missing the blanket and auto impls for most primitive types. To test this, compare nightly [libcore::str] docs, which lack auto traits like Send, with [std::str] docs, which show them. [libcore::str]: https://doc.rust-lang.org/nightly/core/primitive.str.html [libstd::str]: https://doc.rust-lang.org/nightly/std/primitive.str.html It also avoids getting synthetic impls for primitive types on crates that do not actually show them. <details> <summary>Before and After trace logs</summary> ## Before [notriddle@deep-thought test-dingus]$ RUSTDOC_LOG=rustdoc=trace rustdoc +nightly test.rs 2>&1 | grep -E 'get_blanket_impls\(' TRACE rustdoc::clean::blanket_impl get_blanket_impls(Whatever) TRACE rustdoc::clean::blanket_impl get_blanket_impls(isize) TRACE rustdoc::clean::blanket_impl get_blanket_impls([T]) TRACE rustdoc::clean::blanket_impl get_blanket_impls([u8]) TRACE rustdoc::clean::blanket_impl get_blanket_impls([T]) TRACE rustdoc::clean::blanket_impl get_blanket_impls([u8]) TRACE rustdoc::clean::blanket_impl get_blanket_impls(char) TRACE rustdoc::clean::blanket_impl get_blanket_impls(u128) TRACE rustdoc::clean::blanket_impl get_blanket_impls(u16) TRACE rustdoc::clean::blanket_impl get_blanket_impls(i128) TRACE rustdoc::clean::blanket_impl get_blanket_impls(i16) TRACE rustdoc::clean::blanket_impl get_blanket_impls(str) TRACE rustdoc::clean::blanket_impl get_blanket_impls(str) TRACE rustdoc::clean::blanket_impl get_blanket_impls(f64) TRACE rustdoc::clean::blanket_impl get_blanket_impls(f64) TRACE rustdoc::clean::blanket_impl get_blanket_impls(u64) TRACE rustdoc::clean::blanket_impl get_blanket_impls(u8) TRACE rustdoc::clean::blanket_impl get_blanket_impls(i64) TRACE rustdoc::clean::blanket_impl get_blanket_impls(i8) TRACE rustdoc::clean::blanket_impl get_blanket_impls(*const T) TRACE rustdoc::clean::blanket_impl get_blanket_impls(*mut T) TRACE rustdoc::clean::blanket_impl get_blanket_impls(*const [T]) TRACE rustdoc::clean::blanket_impl get_blanket_impls(*mut [T]) TRACE rustdoc::clean::blanket_impl get_blanket_impls([T; N]) TRACE rustdoc::clean::blanket_impl get_blanket_impls(bool) TRACE rustdoc::clean::blanket_impl get_blanket_impls(f32) TRACE rustdoc::clean::blanket_impl get_blanket_impls(f32) TRACE rustdoc::clean::blanket_impl get_blanket_impls(u32) TRACE rustdoc::clean::blanket_impl get_blanket_impls(usize) TRACE rustdoc::clean::blanket_impl get_blanket_impls(i32) ## After [notriddle@deep-thought test-dingus]$ RUSTDOC_LOG=rustdoc=trace rustdoc +dev test.rs 2>&1 | grep -E 'get_blanket_impls\(' TRACE rustdoc::clean::blanket_impl get_blanket_impls(Whatever) </details>
2022-04-22Auto merge of #96282 - petrochenkov:unindent, r=GuillaumeGomezbors-131/+89
rustdoc: Unindent doc fragments on `Attributes` construction `Attributes` can be constructed at arbitrary points, even after the `unindent_comments` pass. `Attributes` that are constructed too late end up unindented. All doc fragments need to be eventually indented before use, so there are no reasons to not do this immediately during their construction. Fixes https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/.60unindent_comments.60.20cannot.20work.20as.20a.20separate.20pass. I'm not sure how to make a minimized reproduction, but unindenting the fragments during their construction should fix the issue.. by construction, and I also verified that all doc strings now hit the `resolver_caches.markdown_links` cache in https://github.com/rust-lang/rust/pull/94857.