Commit graph

512 commits

Author SHA1 Message Date
Guillaume Gomez
123ea25542 Correctly handle line comments in attributes and generate extern crates
outside of wrapping function
2025-03-27 11:18:43 +01:00
binarycat
b46412f6d7 rustdoc: be more strict about "Methods from Deref"
hack: is_doc_subtype_of always returns true for TyAlias

it's worth noting that this function is only used in
the handling of "Methods from Deref", and we were previously
assuming all generic parameters were meaningless,
so this is still an improvment from the status quo.

this change means that we will have strictly less false positives
without adding any new false negitives.

Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2025-03-22 12:47:05 -05:00
Michael Goulet
e3ac1fa81a Add RTN support to rustdoc 2025-03-15 18:13:27 +00:00
Michael Goulet
00132141c7
Rollup merge of #137764 - compiler-errors:always-applicable-negative-impl, r=lcnr
Ensure that negative auto impls are always applicable

r? lcnr (or reassign if you dont want to review)

https://github.com/rust-lang/rust/issues/68318#issuecomment-2689265030
2025-03-06 12:22:16 -05:00
Michael Goulet
cc5d90cbad
Rollup merge of #137534 - xizheyin:issue-137342, r=GuillaumeGomez
[rustdoc] hide item that is not marked as doc(inline) and whose src is doc(hidden)

Part of #137342

![image](https://github.com/user-attachments/assets/68b4649a-a64a-43b2-8a73-6ac92b486e9e)
2025-03-06 12:22:12 -05:00
Michael Goulet
05a80608b3 Make rustdoc tests use always applicable negative auto impls 2025-03-04 18:04:07 +00:00
xizheyin
133705c402 [rustdoc] hide item that is not marked as doc(inline) and whose src is doc(hidden)
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-03-04 01:35:48 +08:00
Yotam Ofek
0881dba5d3 Move "unused_exter_crate" test from rustdoc-ui to rustdoc 2025-02-27 13:22:46 +00:00
León Orell Valerian Liehr
ef539221f6
Rollup merge of #137320 - tapanprakasht:fix-doc-version-stability, r=notriddle
fix(rustdoc): Fixed stability version in rustdoc

Tries to fix https://github.com/rust-lang/rust/issues/137141
Fixed by adding checks glob exports
2025-02-26 04:15:03 +01:00
Ralf Jung
6eea027aa9 remove support for rustc_intrinsic_must_be_overridden from the compiler 2025-02-24 07:53:59 +01:00
Tapan Prakash
afc89a1e02 Fixed tidy error 2025-02-23 22:24:00 +05:30
Tapan Prakash
6fc19785f7 fixed by differentiating glob export 2025-02-23 22:17:18 +05:30
Yotam Ofek
2c1f48970c fix rustdoc test directives that were accidentally ignored
replace "// @" with "//@ ", and fix the tests so they actually pass, after directives are checked
2025-02-16 19:34:50 +00:00
Guillaume Gomez
9e0c8b67e9 Add regression test for source line numbers 2025-02-11 14:29:58 +01:00
Guillaume Gomez
673fd23dff Update rustdoc tests 2025-02-11 14:29:58 +01:00
Matthias Krüger
a8ecb79d19
Rollup merge of #136274 - compiler-errors:sized-wf, r=lcnr
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-04 18:49:37 +01:00
bors
8a8b464175 Auto merge of #136525 - matthiaskrgr:rollup-m8kqlek, r=matthiaskrgr
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-04 06:04:42 +00:00
Matthias Krüger
f8f31faeb7
Rollup merge of #134807 - poliorcetics:ab/push-skpynvsmwkll, r=camelid
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-04 06:13:57 +01:00
Michael Goulet
36839759ce Add missing lang items in no_core tests in rustdoc 2025-02-04 01:05:31 +00:00
Matthias Krüger
2c6c7f8ef2
Rollup merge of #136411 - dtolnay:fnptr, r=notriddle
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-03 21:11:34 +01:00
Ralf Jung
3320e91575 rustc_allowed_through_unstable_modules: require deprecation message 2025-02-02 12:36:12 +01:00
David Tolnay
b866debf3c
Omit argument names from function pointers that do not have argument names 2025-02-01 15:04:19 -08:00
David Tolnay
5f447a1ca6
Add test of fn pointer without argument name 2025-02-01 14:36:42 -08:00
Alexis (Poliorcetics) Bourget
a063cf5f1c
fix(rustdoc): always use a channel when linking to doc.rust-lang.org 2025-01-30 21:12:50 +01:00
Michael Howell
c17d5689da
Direct link 108459 to issues -> pull redirect 2025-01-30 12:09:33 -07:00
Michael Howell
a1a55a2e0a Give 104145, 103463, and 31948 more descriptive names 2025-01-30 12:05:31 -07:00
Michael Howell
eb457da5ca rustdoc: rename issue-\d+.rs tests to have meaningful names 2025-01-29 11:38:15 -07:00
Michael Howell
fdef34b4dd Add URL and crate_name to test cases 2025-01-29 11:21:52 -07:00
FedericoBruzzone
cef97bce7b Add TooGeneric variant to LayoutError and emit Unknown one
- `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-27 00:37:34 +01:00
León Orell Valerian Liehr
ff7cf142c0
rustdoc: Finalize dyn compatibility renaming 2025-01-22 05:03:54 +01:00
Guillaume Gomez
20443dbe1b Remove unused item-row CSS class 2025-01-19 11:47:32 +01:00
Guillaume Gomez
b3865d1832 Remove more CSS classes 2025-01-18 20:29:55 +01:00
Guillaume Gomez
3c62ccdff5 Update rustdoc tests 2025-01-17 22:36:49 +01:00
Matthias Krüger
aeadee0642
Rollup merge of #134216 - GuillaumeGomez:jump-to-def-pats, r=fmease
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-14 19:25:04 +01:00
Michael Howell
916cfbcd3e rustdoc: use import stability marker in display 2025-01-11 15:04:48 -07:00
Matthias Krüger
0e48e96e65
Rollup merge of #135171 - notriddle:notriddle/stable-path-is-better, r=GuillaumeGomez
rustdoc: use stable paths as preferred canonical paths

This accomplishes something like 16a4ad7d7b, but with the `rustc_allowed_through_unstable_modules` attribute instead of the path length.

Fixes #131676
2025-01-07 21:39:41 +01:00
Jacob Pratt
1b370d32d6
Rollup merge of #135116 - camelid:sidebar-case, r=fmease
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-06 22:04:16 -05:00
Noah Lev
b0aaa386d8 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-06 14:26:07 -08:00
Michael Howell
c7a806ad08 rustdoc: use stable paths as preferred canonical paths
This accomplishes something like 16a4ad7d7b,
but with the `rustc_allowed_through_unstable_modules` attribute instead
of the path length.
2025-01-06 11:58:52 -07:00
dxsullivan
bb16267a65 chore: fix typos
Signed-off-by: dxsullivan <193140725+dxsullivan@users.noreply.github.com>
2024-12-31 23:46:39 +08:00
Michael Goulet
aac741a465 Unsafe binder support in rustdoc 2024-12-31 01:08:43 +00:00
Michael Howell
da1c1c33ab Adjust test for slightly changed inlining behavior 2024-12-26 18:31:55 -07:00
Michael Howell
16a4ad7d7b rustdoc: use shorter paths as preferred canonical paths
This is a solution to the `std::sync::poison` linking problem,
and, in general, makes intra-doc links shorter and clearer.
2024-12-26 15:46:36 -07:00
Jacob Pratt
f14d69c853
Rollup merge of #134321 - dtolnay:docassocconst, r=fmease
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-20 01:36:47 -05:00
David Tolnay
6bdfd12ee9
Suppress = _ on associated constants in impls 2024-12-19 10:48:01 -08:00
David Tolnay
da89d10264
Add test for rustdoc showing underscore as assoc const value 2024-12-19 10:47:14 -08:00
许杰友 Jieyou Xu (Joe)
bd6ed18260
Rollup merge of #134432 - GuillaumeGomez:intra-doc-in-footnotes, r=notriddle
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-19 16:48:09 +08:00
Guillaume Gomez
a01de760bb Add regression test for #132208 2024-12-17 17:32:11 +01:00
Nicholas Nethercote
121e87bf14 Remove rustc::existing_doc_keyword lint.
`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-17 13:56:10 +11:00
Michael Goulet
c605c84be8 Stabilize async closures 2024-12-13 00:04:56 +00:00