about summary refs log tree commit diff
path: root/tests/rustdoc
AgeCommit message (Collapse)AuthorLines
2025-02-23Fixed tidy errorTapan Prakash-1/+1
2025-02-23fixed by differentiating glob exportTapan Prakash-0/+28
2025-02-16fix rustdoc test directives that were accidentally ignoredYotam Ofek-17/+17
replace "// @" with "//@ ", and fix the tests so they actually pass, after directives are checked
2025-02-11Add regression test for source line numbersGuillaume Gomez-0/+35
2025-02-11Update rustdoc testsGuillaume Gomez-4/+5
2025-02-04Rollup merge of #136274 - compiler-errors:sized-wf, r=lcnrMatthias Krüger-4/+21
Check Sizedness of return type in WF Still need to clean this up a bit. This should fix https://github.com/rust-lang/trait-system-refactor-initiative/issues/150. r? lcnr
2025-02-04Auto merge of #136525 - matthiaskrgr:rollup-m8kqlek, r=matthiaskrgrbors-2/+2
Rollup of 6 pull requests Successful merges: - #134807 (fix(rustdoc): always use a channel when linking to doc.rust-lang.org) - #134814 (Add `kl` and `widekl` target features, and the feature gate) - #135836 (bootstrap: only build `crt{begin,end}.o` when compiling to MUSL) - #136022 (Port ui/simd tests to use the intrinsic macro) - #136309 (set rustc dylib on manually constructed rustc command) - #136462 (mir_build: Simplify `lower_pattern_range_endpoint`) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-04Rollup merge of #134807 - poliorcetics:ab/push-skpynvsmwkll, r=camelidMatthias Krüger-2/+2
fix(rustdoc): always use a channel when linking to doc.rust-lang.org Closes #131971 I manually checked the resulting links One issue is that this will create `nightly/...` links in places that formerly linked to stable, is that ok ? (the `slice` and `array` links in the search help notably)
2025-02-04Add missing lang items in no_core tests in rustdocMichael Goulet-4/+21
2025-02-03Rollup merge of #136411 - dtolnay:fnptr, r=notriddleMatthias Krüger-6/+14
Omit argument names from function pointers that do not have argument names This matches the style used for the vast majority of function pointer types in real-world code, in my experience. Prefixing `_: ` to every argument does not improve clarity. **Before:** <img src="https://github.com/user-attachments/assets/f07efa8b-d57e-4897-aa97-40db7d207862"> **After:** <img src="https://github.com/user-attachments/assets/8405e08b-d6d2-4904-bcc3-a3eb866cecf0">
2025-02-02rustc_allowed_through_unstable_modules: require deprecation messageRalf Jung-3/+3
2025-02-01Omit argument names from function pointers that do not have argument namesDavid Tolnay-7/+7
2025-02-01Add test of fn pointer without argument nameDavid Tolnay-0/+8
2025-01-30fix(rustdoc): always use a channel when linking to doc.rust-lang.orgAlexis (Poliorcetics) Bourget-2/+2
2025-01-30Direct link 108459 to issues -> pull redirectMichael Howell-1/+1
2025-01-30Give 104145, 103463, and 31948 more descriptive namesMichael Howell-0/+0
2025-01-29rustdoc: rename `issue-\d+.rs` tests to have meaningful namesMichael Howell-30/+0
2025-01-29Add URL and `crate_name` to test casesMichael Howell-32/+77
2025-01-27Add `TooGeneric` variant to `LayoutError` and emit `Unknown` oneFedericoBruzzone-1/+8
- `check-pass` test for a MRE of #135020 - fail test for #135138 - switch to `TooGeneric` for checking CMSE fn signatures - switch to `TooGeneric` for compute `SizeSkeleton` (for transmute) - fix broken tests
2025-01-22rustdoc: Finalize dyn compatibility renamingLeón Orell Valerian Liehr-1/+1
2025-01-19Remove unused `item-row` CSS classGuillaume Gomez-2/+2
2025-01-18Remove more CSS classesGuillaume Gomez-90/+83
2025-01-17Update rustdoc testsGuillaume Gomez-51/+37
2025-01-14Rollup merge of #134216 - GuillaumeGomez:jump-to-def-pats, r=fmeaseMatthias Krüger-0/+52
Enable "jump to def" feature on patterns Part of https://github.com/rust-lang/rust/issues/89095. Pattern (as in "patterns in pattern matching") were not handled by the feature, it's now added. It all started when I realized that prelude values like `Some` or `Err` were not getting a link generated either (added support for it in the first commit). r? ``@fmease``
2025-01-11rustdoc: use import stability marker in displayMichael Howell-0/+18
2025-01-07Rollup merge of #135171 - notriddle:notriddle/stable-path-is-better, ↵Matthias Krüger-0/+40
r=GuillaumeGomez rustdoc: use stable paths as preferred canonical paths This accomplishes something like 16a4ad7d7b0d163f7be6803c786c3b83d42913bb, but with the `rustc_allowed_through_unstable_modules` attribute instead of the path length. Fixes #131676
2025-01-06Rollup merge of #135116 - camelid:sidebar-case, r=fmeaseJacob Pratt-2/+2
rustdoc: Fix mismatched capitalization in sidebar Previously, the main content used "Aliased Type", while the sidebar said "Aliased type". Now, they both say "Aliased Type", which is the more common capitalization in Rustdoc. See the following link for an example. https://doc.rust-lang.org/1.83.0/std/io/type.Result.html
2025-01-06rustdoc: Fix mismatched capitalization in sidebarNoah Lev-2/+2
Previously, the main content used "Aliased Type", while the sidebar said "Aliased type". Now, they both say "Aliased Type", which is the more common capitalization in Rustdoc. See the following link for an example. https://doc.rust-lang.org/1.83.0/std/io/type.Result.html
2025-01-06rustdoc: use stable paths as preferred canonical pathsMichael Howell-0/+40
This accomplishes something like 16a4ad7d7b0d163f7be6803c786c3b83d42913bb, but with the `rustc_allowed_through_unstable_modules` attribute instead of the path length.
2024-12-31chore: fix typosdxsullivan-1/+1
Signed-off-by: dxsullivan <193140725+dxsullivan@users.noreply.github.com>
2024-12-31Unsafe binder support in rustdocMichael Goulet-0/+19
2024-12-26Adjust test for slightly changed inlining behaviorMichael Howell-1/+1
2024-12-26rustdoc: use shorter paths as preferred canonical pathsMichael Howell-0/+40
This is a solution to the `std::sync::poison` linking problem, and, in general, makes intra-doc links shorter and clearer.
2024-12-20Rollup merge of #134321 - dtolnay:docassocconst, r=fmeaseJacob Pratt-1/+31
Hide `= _` as associated constant value inside impl blocks Closes #134320. ### Before: <img src="https://github.com/user-attachments/assets/19d28811-45d2-4563-9726-f40c6af411c6" width="300">&nbsp;<img src="https://github.com/user-attachments/assets/1ecf8764-97ce-47f0-87fa-3b174d2fc578" width="300"> ### After: <img src="https://github.com/user-attachments/assets/6408c4ca-b1c4-42e4-884b-248833a4865f" width="300">&nbsp;<img src="https://github.com/user-attachments/assets/df2f6981-16f6-409f-8abb-73c0a4a71d6b" width="300"> r? `@fmease`
2024-12-19Suppress `= _` on associated constants in implsDavid Tolnay-4/+7
2024-12-19Add test for rustdoc showing underscore as assoc const valueDavid Tolnay-0/+27
2024-12-19Rollup merge of #134432 - GuillaumeGomez:intra-doc-in-footnotes, r=notriddle许杰友 Jieyou Xu (Joe)-0/+24
Fix intra doc links not generated inside footnote definitions Fixes #132208. The problem was that we were running the `Footnote` "pass" before the `LinkReplacer` one. Sadly, the change is bigger than it should because we can't specialize the `Iterator` trait implementation, forcing me to add a new type to handle the other `Iterator` kind (the one which still has the `Range`). r? ``@notriddle``
2024-12-17Add regression test for #132208Guillaume Gomez-0/+24
2024-12-17Remove `rustc::existing_doc_keyword` lint.Nicholas Nethercote-2/+2
`CheckAttrVisitor::check_doc_keyword` checks `#[doc(keyword = "..")]` attributes to ensure they are on an empty module, and that the value is a non-empty identifier. The `rustc::existing_doc_keyword` lint checks these attributes to ensure that the value is the name of a keyword. It's silly to have two different checking mechanisms for these attributes. This commit does the following. - Changes `check_doc_keyword` to check that the value is the name of a keyword (avoiding the need for the identifier check, which removes a dependency on `rustc_lexer`). - Removes the lint. - Updates tests accordingly. There is one hack: the `SelfTy` FIXME case used to used to be handled by disabling the lint, but now is handled with a special case in `is_doc_keyword`. That hack will go away if/when the FIXME is fixed. Co-Authored-By: Guillaume Gomez <guillaume1.gomez@gmail.com>
2024-12-13Stabilize async closuresMichael Goulet-2/+0
2024-12-12Add regression test for patterns support in "jump to def" featureGuillaume Gomez-0/+52
2024-11-25Add regression test for prelude typesGuillaume Gomez-0/+23
2024-11-18Add regression test for jump to def links on items with genericsGuillaume Gomez-0/+14
2024-11-14Add regression test for #131946Guillaume Gomez-0/+20
2024-11-13Rollup merge of #133000 - GuillaumeGomez:footnote-ids, r=notriddleMatthias Krüger-0/+41
[rustdoc] Fix duplicated footnote IDs Fixes https://github.com/rust-lang/rust/issues/131901. Footnote IDs were increased locally (ie, on the docblock) and not globally (ie, on the whole item page). cc `@aDotInTheVoid` r? `@notriddle`
2024-11-13Rollup merge of #132302 - fmease:rustdoc-better-vis-for-macro-decl, r=notriddleMatthias Krüger-20/+10
rustdoc: Treat declarative macros more like other item kinds Apparently at some time in the past we were unable to generate an href for the module path inside the visibility of decl macros 2.0 (`pub(in ...)`). As a result of this, a whole separate function was introduced specifically for printing the visibility of decl macros that didn't attempt to generate any links. The description of PR https://github.com/rust-lang/rust/pull/84074 states: > This fixes the overly-complex invariant mentioned in https://github.com/rust-lang/rust/pull/83237#issuecomment-815346570, where the macro source can't have any links in it only because the cache hasn't been populated yet. I can no longer reproduce the original issue. Reusing the existing visibility rendering logic *seems* to work just fine (I couldn't come up with any counterexamples, though I invite you to prove me wrong). * Fixes #83000 * Fixes the visibility showing up "twice" in rustdoc-JSON output: Once as the `visibility` field, once baked into the source[^1] * Fixes `#[doc(hidden)]` not getting rendered on doc(hidden) decl macros 2.0 under `--document-hiden-items` (for decl macros 1.2 the issue remains; I will address this separately when fixing #132304). --- <details><summary>Outdated Section</summary> NOTE: The current version of this PR is committing a UI crime, I'd like to receive feedback on that. Maybe you have a satisfactory solution for how to remedy it. Namely, as you know we have two different ways of / modes for highlighting code with color: 1. Only highlighting links / item paths and avoiding to highlight tokens by kind like keywords (to reduce visual noise and maybe also artifact size). Used for item declarations(\*). 2. Highlighting tokens by kind. Used for code blocks written by the user. (\*): With the notable exception being macro declarations! Well, since this PR reuses the same function for rendering the item visibility (which only makes sense), we have a clash of modes: We now use both ways of highlighting code for decl macros: №1 for the visibility, №2 for the rest. This awkward. See for yourself: * On master: ![Screenshot 2024-10-29 at 03-37-48 by_example_vis_named in decl_macro a b c - Rust](https://github.com/user-attachments/assets/22f0ab6e-9ba9-4c4e-8fb0-0741c91d360b) * On this branch: ![Screenshot 2024-10-29 at 03-36-41 by_example_vis_named in decl_macro a b c - Rust](https://github.com/user-attachments/assets/b11d81a3-3e2e-43cb-a5b8-6773a3048732) </details> Furthermore, we now no longer syntax-highlight declarative macros (be it `macro_rules!` or `macro`) since that was inconsistent with the way we render all other item kinds. See (collapsed) *Outdated Section* above. See also https://github.com/rust-lang/rust/pull/132302#discussion_r1821310783. | On master | On this branch | |---|---| | ![Screenshot 2024-11-13 at 16-12-46 by_example_vis_named in decl_macro a b c - Rust](https://github.com/user-attachments/assets/cb3aeb42-a56d-4ced-80d9-f2694f369af1) | ![Screenshot 2024-11-13 at 16-13-22 by_example_vis_named in decl_macro a b c - Rust](https://github.com/user-attachments/assets/b73bee50-1b85-4862-afba-5ad471443ccc) | [^1]: E.g., `"visibility":{"restricted":{"parent":1,"path":"::a"}},/*OMITTED*/,"inner":{"macro":"pub(in a) macro by_example_vis_named($foo:expr) {\n ...\n}"}`
2024-11-13Add regression test for #131901Guillaume Gomez-0/+41
2024-11-13rustdoc: Treat decl macros like other itemsLeón Orell Valerian Liehr-20/+10
2024-11-10Rollup merge of #132871 - ↵Jacob Pratt-0/+11
lolbinarycat:rustdoc-heterogeneous-first-paragraph-85763, r=aDotInTheVoid add regression test for #85763 closes #85763
2024-11-10add regression test for #85763binarycat-0/+11