Skip to content

fix: allow wildcard params in foreign fn declarations#22415

Merged
ChayimFriedman2 merged 2 commits into
rust-lang:masterfrom
youngspe:extern-wildcard-param
May 23, 2026
Merged

fix: allow wildcard params in foreign fn declarations#22415
ChayimFriedman2 merged 2 commits into
rust-lang:masterfrom
youngspe:extern-wildcard-param

Conversation

@youngspe
Copy link
Copy Markdown
Contributor

A wildcard _ param in an extern block produces a E0130 diagnostic, but compiles just fine.

  • accept wildcards in addition to identifiers for parameters in extern blocks
  • add tests to verify diagnostics are not generated for the simple ident and wildcard case

See https://doc.rust-lang.org/reference/items/external-blocks.html#r-items.extern.fn.param-patterns

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 21, 2026
@youngspe youngspe changed the title allow wildcard params in foreign fn declarations fix: allow wildcard params in foreign fn declarations May 21, 2026
Comment thread crates/hir-def/src/expr_store/lower.rs Outdated
@youngspe youngspe requested a review from ChayimFriedman2 May 21, 2026 21:39
Copy link
Copy Markdown
Contributor

@ChayimFriedman2 ChayimFriedman2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChayimFriedman2 ChayimFriedman2 added this pull request to the merge queue May 23, 2026
Merged via the queue into rust-lang:master with commit 6074746 May 23, 2026
18 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants