about summary refs log tree commit diff
path: root/tests/rustdoc
AgeCommit message (Collapse)AuthorLines
2025-05-05Created `tests/rustdoc/jump-to-def` subfolder to limit number of files at ↵Guillaume Gomez-0/+0
the top level
2025-05-05Created `tests/rustdoc/auto` subfolder to limit number of files at the top levelGuillaume Gomez-0/+0
2025-05-05Created `tests/rustdoc/anchors` subfolder to limit number of files at the ↵Guillaume Gomez-0/+0
top level
2025-05-05Created `tests/rustdoc/source-code-pages` subfolder to limit number of files ↵Guillaume Gomez-0/+0
at the top level
2025-05-05Created `tests/rustdoc/reexports` subfolder to limit number of files at the ↵Guillaume Gomez-0/+22
top level
2025-04-25Rollup merge of #137096 - ehuss:stabilize-doctest-xcompile, r=fmeaseMatthias Krüger-0/+34
Stabilize flags for doctest cross compilation This makes the following changes in preparation for supporting doctest cross-compiling in cargo: - Renames `--runtool` and `--runtool-arg` to `--test-runtool` and `--test-runtool-arg` to maintain consistency with other `--test-*` arguments. - Stabilizes the `--test-runtool` and `--test-runtool-arg`. These are needed in order to support cargo's `target.runner` option which specifies a runner to execute a cross-compiled doctest (for example, qemu). - Stabilizes the `--enable-per-target-ignores` flag by removing it and making it unconditionally enabled. This makes it possible to disable a doctest on a per-target basis, which I think will be helpful for rolling out this feature. These changes were suggested in https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/stabilizing.20doctest.20xcompile/near/409281127 The intent is to stabilize the doctest-xcompile feature in cargo. This will help ensure that for projects that do cross-compile testing that their doctests are also covered. Currently there is a somewhat surprising behavior that they are ignored. Closes https://github.com/rust-lang/rust/issues/64245 try-job: x86_64-msvc-1
2025-04-18Rollup merge of #139913 - fmease:rustdoc-fix-fn-param-handling, r=GuillaumeGomezMatthias Krüger-8/+57
rustdoc/clean: Fix lowering of fn params (fixes correctness & HIR vs. middle parity regressions) **(0)** PR #136411 aimed to stop rendering unnamed params of fn ptr types as underscores in the common case (e.g., `fn(_: i32)` → `fn(i32)`) to make the rendered output stylistically more conventional. **(0.a)** However, since the cleaning fn that the PR modified is also used for lowering the HIR params of foreign fns and required assoc fns in traits, it accidentally butchered the rendering of the latter two: ```rs pub trait Trait { fn assoc_fn(_: i32); } // as well as (Rust 2015 only): fn assoc_fn(i32); unsafe extern "C" { pub fn foreign_fn(_: i32); } // Since 1.86 the fns above gets mis-rendered as: pub fn assoc_fn(: i32) // <-- BUTCHERED pub unsafe extern "C" fn foreign_fn(: i32) // <-- BUTCHERED ``` **(0.b)** Furthermore, it broke parity with middle cleaning (which includes inlined cross-crate re-exports) re-regressing parts of #44306 I once fixed in PR #103885. **(1)** Lastly, PR #139035 introduced an ICE triggered by the following input file: ```rs trait Trait { fn anon(()) {} } // internal error: entered unreachable code ``` --- This PR fixes all of these regressions and in the first commit renames several types and fns to be more ~~correct~~ descriptive and legible. ~~It also refactors `Param.name` to be of type `Option<Symbol>` instead `Symbol` (where `None` ~ `kw::Empty`), so rendering mistakes like that can no longer creep in like that (ignoring tests). CC #137978.~~ Independently done in PR #139846 a day prior.
2025-04-17rustdoc: Properly clean fn params in all contextsLeón Orell Valerian Liehr-8/+57
2025-04-17Support inlined cross-crate re-exported trait aliasesLeón Orell Valerian Liehr-39/+95
2025-04-10replace `//@ compile-flags: --edition` with `//@ edition`Pietro Albini-8/+16
2025-03-27Stabilize --test-runtool and --test-runtool-argEric Huss-1/+0
2025-03-27Rename `--runtool` and `--runtool-arg`Eric Huss-3/+3
This renames `--runtool` and `--runtool-arg` to `--test-runtool` and `--test-runtool-arg` to maintain consistency with other `--test-*` arguments.
2025-03-27Add test for doctest runtoolEric Huss-0/+35
2025-03-27Correctly handle line comments in attributes and generate extern cratesGuillaume Gomez-1/+1
outside of wrapping function
2025-03-22rustdoc: be more strict about "Methods from Deref"binarycat-0/+27
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-15Add RTN support to rustdocMichael Goulet-0/+18
2025-03-06Rollup merge of #137764 - compiler-errors:always-applicable-negative-impl, ↵Michael Goulet-2/+2
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-06Rollup merge of #137534 - xizheyin:issue-137342, r=GuillaumeGomezMichael Goulet-24/+40
[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-04Make rustdoc tests use always applicable negative auto implsMichael Goulet-2/+2
2025-03-04[rustdoc] hide item that is not marked as doc(inline) and whose src is ↵xizheyin-24/+40
doc(hidden) Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-02-27Move "unused_exter_crate" test from rustdoc-ui to rustdocYotam Ofek-0/+19
2025-02-26Rollup merge of #137320 - tapanprakasht:fix-doc-version-stability, r=notriddleLeón Orell Valerian Liehr-0/+28
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-24remove support for rustc_intrinsic_must_be_overridden from the compilerRalf Jung-16/+4
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