about summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2023-04-20change usages of explicit_item_bounds to bound_explicit_item_boundsKyle Matsuda-8/+11
2023-04-20Remove WithOptconstParam.Camille GILLOT-2/+2
2023-04-19rustdoc-search: give longer notification for type correctionsMichael Howell-2/+7
2023-04-19Fix missing blanket impl if the trait is not directly publicGuillaume Gomez-1/+1
2023-04-19Remove find_map_relevant_implMichael Goulet-9/+11
2023-04-18rustdoc: format type layout template with newline after `<p>`Michael Howell-8/+16
2023-04-18rustdoc: create variants list outside of templateMichael Howell-63/+60
2023-04-18rustdoc: use a separate template for type layout sizeMichael Howell-12/+24
2023-04-18Rollup merge of #110450 - GuillaumeGomez:fix-nested-items-on-private-doc, ↵Matthias Krüger-10/+38
r=notriddle,jyn514 rustdoc: Fix invalid handling of nested items with `--document-private-items` Fixes #110422. The problem is that only impl block and re-exported `macro_rules!` items are "visible" as nested items. This PR adds the missing checks to handle this correctly. cc `@compiler-errors` r? `@notriddle`
2023-04-18Rollup merge of #110348 - ↵Matthias Krüger-0/+2
GuillaumeGomez:disambiguators-suffixes-rustdoc-book, r=Manishearth Add list of supported disambiguators and suffixes for intra-doc links in the rustdoc book This information is otherwise only provided in case an error occurs, which isn't great. r? ```@notriddle```
2023-04-17rustdoc: restructure type search engine to pick-and-use IDsMichael Howell-196/+227
This change makes it so, instead of mixing string distance with type unification, function signature search works by mapping names to IDs at the start, reporting to the user any cases where it had to make corrections, and then matches with IDs when going through the items. This only changes function searches. Name searches are left alone, and corrections are only done when there's a single item in the search query.
2023-04-17rustdoc-search: fix incorrect doc commentMichael Howell-1/+1
2023-04-17Fix invalid handling of nested items with `--document-private-items`Guillaume Gomez-5/+35
2023-04-17Remove unused RustdocVisitor::visit_item_inner return typeGuillaume Gomez-5/+3
2023-04-17Add code comment to remind contributors to update rustdoc book if they ↵Guillaume Gomez-0/+2
update the disambiguators list
2023-04-17Rollup merge of #110421 - jsoref:spelling-librustdoc, r=notriddleMatthias Krüger-23/+23
Spelling librustdoc This is split from https://github.com/rust-lang/rust/pull/110392 There's one change to src/tools/rustdoc-gui/tester.js which feels like a reasonable thing to piggy-back here.
2023-04-17Rollup merge of #110404 - matthiaskrgr:mapmap, r=NilstriebMatthias Krüger-4/+3
fix clippy::toplevel_ref_arg and ::manual_map r? ``@Nilstrieb``
2023-04-17Rollup merge of #110341 - notriddle:notriddle/main-js-replacestate, ↵Matthias Krüger-4/+2
r=GuillaumeGomez rustdoc: stop passing a title to `replaceState` second argument As described on [MDN's replaceState page], this parameter is not currently used, and the empty string is "safe against future changes to the method." [MDN's replaceState page]: https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState
2023-04-16Spelling librustdocJosh Soref-23/+23
* associated * collected * correspondence * inlining * into * javascript * multiline * variadic Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-16Auto merge of #110405 - fee1-dead-contrib:rollup-9rkree6, r=fee1-deadbors-1/+1
Rollup of 4 pull requests Successful merges: - #110397 (Move some utils out of `rustc_const_eval`) - #110398 (use matches! macro in more places) - #110400 (more clippy fixes: clippy::{iter_cloned_collect, unwarp_or_else_defau…) - #110402 (Remove the loop in `Align::from_bytes`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-04-16fix clippy::toplevel_ref_arg and ::manual_mapMatthias Krüger-4/+3
2023-04-16Rollup merge of #110345 - nnethercote:rm-Super-impls-for-Region, ↵fee1-dead-6/+5
r=compiler-errors Remove `TypeSuper{Foldable,Visitable}` impls for `Region`. These traits exist so that folders/visitors can recurse into types of interest: binders, types, regions, predicates, and consts. But `Region` is non-recursive and cannot contain other types of interest, so its methods in these traits are trivial. This commit inlines and removes those trivial methods. r? `@compiler-errors`
2023-04-16more clippy fixes: clippy::{iter_cloned_collect, unwarp_or_else_default, ↵Matthias Krüger-1/+1
option_map_or_none}
2023-04-16Remove `TypeSuper{Foldable,Visitable}` impls for `Region`.Nicholas Nethercote-6/+5
These traits exist so that folders/visitors can recurse into types of interest: binders, types, regions, predicates, and consts. But `Region` is non-recursive and cannot contain other types of interest, so its methods in these traits are trivial. This commit inlines and removes those trivial methods.
2023-04-15rustdoc: stop passing a title to `replaceState` second argumentMichael Howell-4/+2
As described on [MDN's replaceState page], this parameter is not currently used, and the empty string is "safe against future changes to the method." [MDN's replaceState page]: https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState
2023-04-15fix clippy::{filter_map_identiy, map_identity, manual_flatten}Matthias Krüger-1/+1
2023-04-15Auto merge of #109802 - notriddle:notriddle/rustdoc-search-generics-nested, ↵bors-11/+10
r=GuillaumeGomez rustdoc-search: add support for nested generics This change allows `search.js` to parse nested generics (which look `Like<This<Example>>`) and match them. It maintains the existing "bag semantics", so that the order of type parameters is ignored but the number is required to be greater than or equal to what's in the query. For example, a function with the signature `fn read_all(&mut self: impl Read) -> Result<Vec<u8>, Error>` will match these queries: * `Read -> Result<Vec<u8>, Error>` * `Read -> Result<Error, Vec>` * `Read -> Result<Vec<u8>>` But it *does not* match `Result<Vec, u8>` or `Result<u8<Vec>>`.
2023-04-14rustdoc-search: add support for nested genericsMichael Howell-11/+10
2023-04-14Rollup merge of #110244 - kadiwa4:unnecessary_imports, r=JohnTitorMatthias Krüger-9/+2
Remove some unneeded imports / qualified paths Continuation of #105537.
2023-04-14Rollup merge of #110305 - notriddle:notriddle/es6-map-set, r=GuillaumeGomezYuki Okushi-58/+73
rustdoc-search: use ES6 `Map` and `Set` where they make sense Since all supported browsers now support these classes, and rustdoc has started using them in some places, it might as well use them everywhere it makes sense (because, as [MDN's Map page] says, it "performs better in scenarios involving frequent additions and removals of key-value pairs."). [MDN's Map page]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map
2023-04-14Rollup merge of #103682 - Swatinem:stable-run-directory, r=GuillaumeGomezYuki Okushi-1/+1
Stabilize rustdoc `--test-run-directory` This should resolve https://github.com/rust-lang/rust/issues/84674
2023-04-14Rollup merge of #110279 - GuillaumeGomez:compiler-macro-derive, r=notriddleMatthias Krüger-40/+55
rustdoc: Correctly handle built-in compiler proc-macros as proc-macro and not macro Part of https://github.com/rust-lang/rust/issues/110111. There were actually one issue split in two parts: * Compiler built-in proc-macro were incorrectly considered as macros and not proc-macros. * Re-exports of compiler built-in proc-macros were considering them as macros. Both issues can be fixed by looking at the `MacroKind` variant instead of just relying on information extracted later on. r? ``@fmease``
2023-04-14Auto merge of #110160 - petrochenkov:notagain2, r=cjgillotbors-3/+3
resolve: Pre-compute non-reexport module children Instead of repeating the same logic by walking HIR during metadata encoding. The only difference is that we are no longer encoding `macro_rules` items, but we never currently need them as a part of this list. They can be encoded separately if this need ever arises. `module_reexports` is also un-querified, because I don't see any reasons to make it a query, only overhead.
2023-04-13rustdoc-search: use ES6 Map for `Result` instead of ObjectMichael Howell-21/+40
2023-04-13rustdoc-search: use ES6 `Set` for deduplication instead of `Object`Michael Howell-3/+3
2023-04-13rustdoc-search: use ES6 `Map` for generic matching instead of `Object`Michael Howell-23/+14
2023-04-13rustdoc-search: use ES6 `Map` for aliases instead of `Object`Michael Howell-11/+16
2023-04-13Correctly handle built-in compiler proc-macros as proc-macro and not macroGuillaume Gomez-40/+55
2023-04-13Rollup merge of #110072 - joshtriplett:stabilize-is-terminal, r=Mark-SimulacrumMatthias Krüger-1/+0
Stabilize IsTerminal FCP completed in https://github.com/rust-lang/rust/issues/98070 . closes: https://github.com/rust-lang/rust/issues/98070
2023-04-12Auto merge of #110252 - matthiaskrgr:rollup-ovaixra, r=matthiaskrgrbors-10/+4
Rollup of 8 pull requests Successful merges: - #109810 (Replace rustdoc-ui/{c,z}-help tests with a stable run-make test ) - #110035 (fix: ensure bad `#[test]` invocs retain correct AST) - #110089 (sync::mpsc: synchronize receiver disconnect with initialization) - #110103 (Report overflows gracefully with new solver) - #110122 (Fix x check --stage 1 when download-ci-llvm=false) - #110133 (Do not use ImplDerivedObligationCause for inherent impl method error reporting) - #110135 (Revert "Don't recover lifetimes/labels containing emojis as character literals") - #110235 (Fix `--extend-css` option) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-04-12Rollup merge of #110235 - GuillaumeGomez:fix-extend-css, r=notriddleMatthias Krüger-1/+1
Fix `--extend-css` option Fixes #110002. The file was generated in the wrong folder so I moved it into `static.files` as it made more sense to have there instead of changing the path in the templates. I also added a GUI test to ensure that this option won't break unexpectedly again.
2023-04-12Rollup merge of #109810 - jyn514:rustdoc-opt-tests, r=TaKO8KiMatthias Krüger-9/+3
Replace rustdoc-ui/{c,z}-help tests with a stable run-make test This make rustdoc resilient to changes in the debugging options while still testing that it matches rustc. Fixes https://github.com/rust-lang/rust/issues/109391.
2023-04-12Rollup merge of #110237 - oli-obk:impl_trait_in_assoc_tys, r=jackh726Matthias Krüger-0/+1
Split out a separate feature gate for impl trait in associated types in https://github.com/rust-lang/rust/issues/107645 it was decided that we'll take a new route for type alias impl trait. The exact route isn't clear yet, so while I'm working on implementing some of these proposed changes (e.g. in https://github.com/rust-lang/rust/pull/110010) to be able to experiment with them, I will also work on stabilizing another sugar version first: impl trait in associated types. Similarly I'll look into creating feature gates for impl trait in const/static types. This PR does nothing but split the feature gate, so that you need to enable a different feature gate for ```rust impl Trait for Type { type Assoc = impl SomeTrait; } ``` than what you need for `type Foo = impl SomeTrait;`
2023-04-12Rollup merge of #110205 - notriddle:notriddle/pixelated-border, r=GuillaumeGomezMatthias Krüger-1/+5
rustdoc: make settings radio and checks thicker, less contrast This is very dependent on subjectivity and what screen you use, but this change makes the radio buttons' outer circle less ugly. This is because I could see the pixels very clearly, thanks to the very thin line and high contrast. This change makes both less severe, giving your browser's antialiasing algorithm more to work with. Since it's thicker, lowering the contrast shouldn't impact visibility. ## Preview https://notriddle.com/rustdoc-demo-html-3/pixelated-border/settings.html ## Before ![image](https://user-images.githubusercontent.com/1593513/231274191-143acbea-c433-4fb1-b46d-e5e4fe328d60.png) ## After ![image](https://user-images.githubusercontent.com/1593513/231287415-c1e59fe8-8bf8-489d-b607-95ebb71e4ac5.png) <details><summary>Original "after" image with 2px border around checked box</summary> ![image](https://user-images.githubusercontent.com/1593513/231274253-8b5011c6-82fb-4396-84d0-47b6bdff2260.png) </details>
2023-04-12Move creation of `theme.css` file from `--extend-css` command into the ↵Guillaume Gomez-1/+1
`static.files` folder
2023-04-12rustdoc: use CSS `overscroll-behavior` instead of JavaScriptMichael Howell-56/+8
Fixes the desktop scrolling weirdness mentioned in https://github.com/rust-lang/rust/pull/98775#issuecomment-1182575603 As described in the MDN page for this property: * The current Firefox ESR is 102, and the first Firefox version to support this feature is 59. * The current Chrome version 112, and the first version to support this is 63. * Edge is described as having a minor bug in `none` mode, but we use `contain` mode anyway, so it doesn't matter. * Safari 16, released September 2022, is the last browser to add this feature, and is also the oldest version we officially support.
2023-04-12remove some unneeded importsKaDiWa-9/+2
2023-04-12Split out a separate feature gate for impl trait in associated typesOli Scherer-0/+1
2023-04-12rustdoc: make settings radio and checks thicker, less contrastMichael Howell-1/+5
This is very dependent on subjectivity and what screen you use, but this change makes the radio buttons' outer circle less ugly. This is because I could see the pixels very clearly, thanks to the very thin line and high contrast. This change makes both less severe, giving your browser's antialiasing algorithm more to work with. Since it's thicker, lowering the contrast shouldn't impact visibility.
2023-04-12resolve: Pre-compute non-reexport module childrenVadim Petrochenkov-3/+3
Instead of repeating the same logic by walking HIR during metadata encoding. The only difference is that we are no longer encoding `macro_rules` items, but we never currently need them as a part of this list. They can be encoded separately if this need ever arises. `module_reexports` is also un-querified, because I don't see any reasons to make it a query, only overhead.