about summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2022-11-27Auto merge of #104983 - matthiaskrgr:rollup-018sk73, r=matthiaskrgrbors-7/+31
Rollup of 8 pull requests Successful merges: - #95836 (Use `rust_out{exe_suffix}` for doctests) - #104882 (notify lcnr on changes to `ObligationCtxt`) - #104892 (Explain how to get the discriminant out of a `#[repr(T)] enum` with payload) - #104917 (Allow non-org members to label `requires-debug-assertions`) - #104931 (Pretty-print generators with their `generator_kind`) - #104934 (Remove redundant `all` in cfg) - #104944 (Support unit tests for jsondoclint) - #104946 (rustdoc: improve popover focus handling JS) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-27Remove Crate::primitives fieldGuillaume Gomez-5/+6
2022-11-27Rollup merge of #104946 - notriddle:notriddle/popover-menu-focus, ↵Matthias Krüger-5/+17
r=GuillaumeGomez rustdoc: improve popover focus handling JS This commit fixes a few inconsistencies and erratic behavior from the notable traits, settings, and sidebar popups: * It makes it so that pressing Escape closes the mobile sidebar. This is a bit difficult to do on iPhone, but on other setups like desktop tiling window managers, it's easy and makes sense. * It makes sure that pressing escape while a notable trait popover is open focuses the popover's toggle button, instead of leaving nothing focused, since that makes more sense with keyboard navigation. Clicking the settings, help, or sidebar buttons, however, will not focus the notable trait popover toggle button. * It ensures that notable trait and settings popovers are exclusive with the mobile sidebar. Nothing should ever overlap a popover, and there should never be more than one popover open at once.
2022-11-27Auto merge of #104048 - cjgillot:split-lifetime, r=compiler-errorsbors-27/+14
Separate lifetime ident from lifetime resolution in HIR Drive-by: change how suggested generic args are computed. Fixes https://github.com/rust-lang/rust/issues/103815 I recommend reviewing commit-by-commit.
2022-11-27Rename `fn_trait_kind_from_{from_lang=>def_id}` to better convey meaningMaybe Waffle-1/+1
2022-11-26Use target exe_suffix for doctestsJubilee Young-2/+14
This will use rust_out.exe for doctests on Windows, rust_out.wasm for doctests in the wasm case, and also handles cross-compiling or user-provided targets.
2022-11-26Fix UI issues with Rustdoc scrape-examples feature.Will Crichton-3/+5
* Help file was being loaded from the wrong place. * CSS selector in JS has a typo. * Line numbers are overflowing, change to display: grid to fix.
2022-11-26rustdoc: pass "true" to reset focus for notable traitsMichael Howell-11/+7
2022-11-26rustdoc: improve popover focus handling JSMichael Howell-5/+21
This commit fixes a few inconsistencies and erratic behavior from the notable traits, settings, and sidebar popups: * It makes it so that pressing Escape closes the mobile sidebar. This is a bit difficult to do on iPhone, but on other setups like desktop tiling window managers, it's easy and makes sense. * It makes sure that pressing escape while a notable trait popover is open focuses the popover's toggle button, instead of leaving nothing focused, since that makes more sense with keyboard navigation. Clicking the settings, help, or sidebar buttons, however, will not focus the notable trait popover toggle button. * It ensures that notable trait and settings popovers are exclusive with the mobile sidebar. Nothing should ever overlap a popover, and there should never be more than one popover open at once.
2022-11-26Rollup merge of #104928 - notriddle:notriddle/sidebar-toggle-flexbox, ↵Guillaume Gomez-9/+3
r=GuillaumeGomez rustdoc: use flexbox CSS to align sidebar button instead of position This accomplishes the same thing with significantly less code. Preview: https://notriddle.com/notriddle-rustdoc-demos/sidebar-toggle-flexbox/src/test_dingus/lib.rs.html
2022-11-26Rollup merge of #104899 - notriddle:notriddle/help-dt, r=GuillaumeGomezMatthias Krüger-1/+0
rustdoc: remove no-op CSS `#help dt { display: block }` `display: block` is the [default UA style] for dt. [default UA style]: https://html.spec.whatwg.org/multipage/rendering.html#lists
2022-11-25rustdoc: use flexbox CSS to align sidebar button instead of positionMichael Howell-9/+3
This accomplishes the same thing with significantly less code.
2022-11-25Auto merge of #104902 - matthiaskrgr:rollup-oo27a4u, r=matthiaskrgrbors-2/+1
Rollup of 8 pull requests Successful merges: - #104716 (move 2 candidates into builtin candidate) - #104760 (Clarify `SyntaxExtensionKind::LegacyDerive`.) - #104797 (rustc_codegen_ssa: write `.dwp` in a streaming fashion) - #104835 (Use infcx.partially_normalize_associated_types_in) - #104853 (Fix typo in miri sysroot) - #104879 (jsondoclint: Recognise Typedef as valid kind for Type::ResolvedPath) - #104887 (rustbuild: Don't build doc::SharedAssets when building JSON docs.) - #104896 (rustdoc: fix broken tooltip CSS) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-25rustdoc: remove no-op CSS `#help dt { display: block }`Michael Howell-1/+0
`display: block` is the [default UA style] for dt. [default UA style]: https://html.spec.whatwg.org/multipage/rendering.html#lists
2022-11-25rustdoc: revert tooltip background color on light theme to readableMichael Howell-1/+1
text #fff on background #fdffd3 fails the [WCAG color contrast checker], and seems like a mistake in 16b55903ee16503e7026677c169727d1907704c2. [WCAG color contrast checker]: https://accessibleweb.com/color-contrast-checker/
2022-11-25rustdoc: remove `cursor: pointer` from unclickable tooltipMichael Howell-1/+0
It's misleading unless it gets changed to respond to being clicked.
2022-11-25Auto merge of #104846 - ↵bors-20/+31
spastorino:santa-clauses-make-goals-early-christmas-🎄, r=oli-obk Branch Clause from Predicate r? `@oli-obk` This is part of what's proposed in https://github.com/rust-lang/compiler-team/issues/531
2022-11-25Rollup merge of #104849 - GuillaumeGomez:source-code-sidebar-css-migration, ↵Matthias Krüger-20/+14
r=notriddle Migrate source code elements style to CSS variables r? ``@notriddle``
2022-11-25Introduce PredicateKind::ClauseSantiago Pastorino-14/+30
2022-11-25get rid of to_poly_trait_predicateOli Scherer-6/+1
2022-11-24Auto merge of #104845 - matthiaskrgr:rollup-tckj956, r=matthiaskrgrbors-2/+1
Rollup of 11 pull requests Successful merges: - #104514 (Use node_ty_opt to avoid ICE in visit_ty) - #104704 (Allow power10-vector feature in PowerPC) - #104747 (resolve: Don't use constructor def ids in the map for field names) - #104773 (OpaqueCast projections are always overlapping, they can't possibly be disjoint) - #104774 (Document split{_ascii,}_whitespace() for empty strings) - #104780 (make `error_reported` check for delayed bugs) - #104782 (Bump the const eval step limit) - #104792 (rustdoc: simplify `.search-results-title` CSS) - #104796 (lint: do not warn unused parens around higher-ranked function pointers) - #104820 (Remove normalize_projection_type) - #104822 (with_query_mode -> new) Failed merges: - #104716 (move 2 candidates into builtin candidate) - #104841 (Assert that we don't capture escaping bound vars in `Fn` trait selection) r? `@ghost` `@rustbot` modify labels: rollup
2022-11-24Migrate source code elements style to CSS variablesGuillaume Gomez-20/+14
2022-11-24Rollup merge of #104792 - notriddle:notriddle/crate-search-title-display, ↵Matthias Krüger-2/+1
r=GuillaumeGomez rustdoc: simplify `.search-results-title` CSS By using `display: flex`, we still get the never-wrapping layout with `#crate-search-div` maxing out and truncating its text. The title itself winds up always filling its parent, but since `#crate-search` doesn't have `flex-grow` set, it won't fill available space.
2022-11-24Use kw::Empty for elided lifetimes in path.Camille GILLOT-16/+12
2022-11-24move things from rustc_target::abi to rustc_abihkalbasi-2/+2
2022-11-24make rustc_target usable outside of rustchkalbasi-4/+4
2022-11-24Rollup merge of #104772 - GuillaumeGomez:small-accessibility-improvement, ↵Matthias Krüger-18/+16
r=notriddle Small accessibility improvements From this [reddit post](https://www.reddit.com/r/rust/comments/z1gyz7/accessible_documentation/), I started to check a bit how to improve accessibility and how we could add test for it. So these two fixes come from the use of the [pa11y tool](https://github.com/pa11y/pa11y). To make it work, I had to update its puppeteer version to the last one but otherwise it seems to be quite nice. I didn't fix all the errors it reported because they were about colors. To get the same result as mine, you can use this config: ```json { "ignore": [ "WCAG2AA.Principle1.Guideline1_4.1_4_3.G18.Fail", "WCAG2AA.Principle3.Guideline3_2.3_2_2.H32.2" ] } ``` I think trying to improve accessibility is something we should definitely aim for. I'll try to integrate a tool to enforce this check (very likely `pa11y`) directly into the CI. cc ``@jsha`` r? ``@notriddle``
2022-11-23rustdoc: simplify `.search-results-title` CSSMichael Howell-2/+1
By using `display: flex`, we still get the never-wrapping layout with `#crate-search-div` maxing out and truncating its text. The title itself winds up always filling its parent, but since `#crate-search` doesn't have `flex-grow` set, it won't fill available space.
2022-11-23Separate lifetime ident from resolution in HIR.Camille GILLOT-11/+2
2022-11-23Rollup merge of #104744 - notriddle:notriddle/struct-fields-display-block, ↵Dylan DPC-0/+2
r=GuillaumeGomez rustdoc: give struct fields CSS `display: block` Fixes #104737
2022-11-23Improve accessibility:Guillaume Gomez-18/+16
* Set aria-label attribute on search input * Put anchor text directly into the DOM and not in the CSS
2022-11-22Consolidate rustdoc's lint passes into a single passNoah Lev-499/+439
This should improve performance and simplify the code.
2022-11-22Rollup merge of #103488 - oli-obk:impl_trait_for_tait, r=lcnrManish Goregaokar-0/+1
Allow opaque types in trait impl headers and rely on coherence to reject unsound cases r? ````@lcnr```` fixes #99840
2022-11-22rustdoc: make struct fields `display: block`Michael Howell-0/+2
2022-11-22rustdoc: remove no-op CSS `a.test-arrow { display: inline-block }`Michael Howell-1/+0
Since this box is absolutely positioned, its display type is [blockified] anyway. We just need to make sure it isn't `display: none`. [blockified]: https://www.w3.org/TR/css-display-3/#transformations
2022-11-22rustdoc: remove no-op CSS `.popover::before { display: inline-block }`Michael Howell-1/+0
Since this box is absolutely positioned, its display type is [blockified] anyway. We just need to make sure it isn't `display: none`. [blockified]: https://www.w3.org/TR/css-display-3/#transformations
2022-11-22Auto merge of #103578 - petrochenkov:nofict, r=nagisabors-27/+27
Unreserve braced enum variants in value namespace With this PR braced enum variants (`enum E { V { /*...*/ } }`) no longer take a slot in value namespace, so the special case mentioned in the note in https://github.com/rust-lang/rfcs/blob/master/text/1506-adt-kinds.md#braced-structs is removed. Report - https://github.com/rust-lang/rust/pull/103578#issuecomment-1292594900.
2022-11-22Auto merge of #104696 - matthiaskrgr:rollup-gi1pdb0, r=matthiaskrgrbors-33/+21
Rollup of 11 pull requests Successful merges: - #103396 (Pin::new_unchecked: discuss pinning closure captures) - #104416 (Fix using `include_bytes` in pattern position) - #104557 (Add a test case for async dyn* traits) - #104559 (Split `MacArgs` in two.) - #104597 (Probe + better error messsage for `need_migrate_deref_output_trait_object`) - #104656 (Move tests) - #104657 (Do not check transmute if has non region infer) - #104663 (rustdoc: factor out common button CSS) - #104666 (Migrate alias search result to CSS variables) - #104674 (Make negative_impl and negative_impl_exists take the right types) - #104692 (Update test's cfg-if dependency to 1.0) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-22Rollup merge of #104666 - GuillaumeGomez:migrate-alias-search-result, ↵Matthias Krüger-24/+16
r=notriddle Migrate alias search result to CSS variables r? `@notriddle`
2022-11-22Rollup merge of #104663 - notriddle:notriddle/button-cursor, r=GuillaumeGomezMatthias Krüger-8/+4
rustdoc: factor out common button CSS
2022-11-22Split `MacArgs` in two.Nicholas Nethercote-1/+1
`MacArgs` is an enum with three variants: `Empty`, `Delimited`, and `Eq`. It's used in two ways: - For representing attribute macro arguments (e.g. in `AttrItem`), where all three variants are used. - For representing function-like macros (e.g. in `MacCall` and `MacroDef`), where only the `Delimited` variant is used. In other words, `MacArgs` is used in two quite different places due to them having partial overlap. I find this makes the code hard to read. It also leads to various unreachable code paths, and allows invalid values (such as accidentally using `MacArgs::Empty` in a `MacCall`). This commit splits `MacArgs` in two: - `DelimArgs` is a new struct just for the "delimited arguments" case. It is now used in `MacCall` and `MacroDef`. - `AttrArgs` is a renaming of the old `MacArgs` enum for the attribute macro case. Its `Delimited` variant now contains a `DelimArgs`. Various other related things are renamed as well. These changes make the code clearer, avoids several unreachable paths, and disallows the invalid values.
2022-11-21Stop passing the self-type as a separate argument.Oli Scherer-1/+1
2022-11-21Allow iterators instead of requiring slices that will get turned into iteratorsOli Scherer-1/+1
2022-11-21Assert that various types have the right amount of generic args and fix the ↵Oli Scherer-1/+1
sites that used the wrong amount
2022-11-21Unreserve braced enum variants in value namespaceVadim Petrochenkov-27/+27
2022-11-21Add an always-ambiguous predicate to make sure that we don't accidentlally ↵Oli Scherer-0/+1
allow trait resolution to prove false things during coherence
2022-11-21Rollup merge of #104499 - Enselic:no-method-in-rustdoc-json, r=GuillaumeGomezMatthias Krüger-22/+7
rustdoc JSON: Use `Function` everywhere and remove `Method` Closes #100259
2022-11-21Migrate search result alias to CSS variablesGuillaume Gomez-24/+16
2022-11-20rustdoc: factor out common button CSSMichael Howell-8/+4
2022-11-20Rollup merge of #104581 - notriddle:notriddle/js-iife-2, r=GuillaumeGomezMatthias Krüger-6/+3
rustdoc: remove unused JS IIFE from main.js This [IIFE] made sense when it was added in deaf5e200e79a75ac57d3f0952f6758a38168e52 and there was a local variable scoped to it, but now it calls a function, but declares nothing. [IIFE]: https://developer.mozilla.org/en-US/docs/Glossary/IIFE "immediately invoked function expression"