rust/tests/rustdoc/auxiliary
Matthias Krüger cbf26629c4
Rollup merge of #139913 - fmease:rustdoc-fix-fn-param-handling, r=GuillaumeGomez
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-18 05:16:31 +02:00
..
alias-reexport.rs Add rustdoc tests for lazy_type_alias 2023-06-21 13:45:00 +02:00
alias-reexport2.rs Update tests/rustdoc to new test syntax 2024-06-24 11:08:41 +02:00
all-item-types.rs
async-trait-dep.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
auto-traits.rs
cross-crate-hidden-assoc-trait-items.rs
cross-crate-hidden-impl-parameter.rs
cross_crate_generic_typedef.rs Add failing test for cross-crate enum in type alias 2024-05-19 20:13:18 -04:00
elided-lifetime.rs
empty.rs
enum-primitive.rs
enum-variant.rs Add tests for enum discriminant value display with repr 2023-10-11 23:44:12 +02:00
ext-anon-fn-params.rs rustdoc: Properly clean fn params in all contexts 2025-04-17 08:55:53 +02:00
ext-trait-aliases.rs Support inlined cross-crate re-exported trait aliases 2025-04-17 02:35:05 +02:00
extern-impl-trait.rs
extern-links.rs
external-cross-doc.md
external-cross.rs
external-doc.md
external-macro-src.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
html_root.rs
incoherent-impl-types.rs
inline-default-methods.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
issue-13698.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
issue-15318.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
issue-17476.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
issue-19190-3.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
issue-20646.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
issue-20727.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
issue-21092.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
issue-22025.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
issue-26606-macro.rs
issue-28927-1.rs
issue-28927-2.rs
issue-30109-1.rs
issue-34274.rs
issue-53689.rs
issue-61592.rs
issue-86620-1.rs
issue-99221-aux.rs
issue-99734-aux.rs
issue-100204-aux.rs
issue-106421-force-unstable.rs Add test cases for inlining compiler-private items 2024-02-24 15:38:55 -07:00
issue-113982-doc_auto_cfg-reexport-foreign.rs Add regression test for #113982 2023-07-24 16:32:06 +02:00
jump-to-def-macro.rs Add regression test for link generation on foreign macro in jump to defintion feature 2024-02-27 16:20:11 +01:00
jump-to-def-res-err-handling-aux.rs Fix regression for private in public 2023-07-26 15:29:45 +02:00
macro_pub_in_module.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
masked.rs
mod-stackoverflow.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
no_html_root.rs
normalize-assoc-item.rs
panic-item.rs Move "unused_exter_crate" test from rustdoc-ui to rustdoc 2025-02-27 13:22:46 +00:00
precise-capturing.rs Add cross-crate precise capturing support to rustdoc 2024-07-17 11:06:10 -04:00
primitive-doc.rs replace //@ compile-flags: --edition with //@ edition 2025-04-10 09:56:37 +02:00
primitive-reexport.rs replace //@ compile-flags: --edition with //@ edition 2025-04-10 09:56:37 +02:00
pub-extern-crate.rs
pub-use-extern-macros.rs
real_gimli.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
realcore.rs
reexp-stripped.rs
reexport-check.rs
reexport-doc-aux.rs
reexports.rs
rustdoc-default-impl.rs
rustdoc-extern-default-method.rs
rustdoc-extern-method.rs
rustdoc-ffi.rs Update tests/rustdoc to new test syntax 2024-06-24 11:08:41 +02:00
rustdoc-impl-parts-crosscrate.rs
source-code-bar.rs
source_code.rs
src-links-external.rs
trait-visibility.rs
unit-return.rs
unsafe-binder-dep.rs Unsafe binder support in rustdoc 2024-12-31 01:08:43 +00:00
unstable-trait.rs
variant-struct.rs