Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omit argument names from function pointers that do not have argument names #136411

Merged
merged 2 commits into from
Feb 4, 2025

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Feb 1, 2025

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:

After:

@rustbot
Copy link
Collaborator

rustbot commented Feb 1, 2025

r? @notriddle

rustbot has assigned @notriddle.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Feb 1, 2025
@notriddle
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Feb 3, 2025

📌 Commit b866deb has been approved by notriddle

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 3, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 3, 2025
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">
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 4, 2025
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#136289 (OnceCell & OnceLock docs: Using (un)initialized consistently)
 - rust-lang#136299 (Ignore NLL boring locals in polonius diagnostics)
 - rust-lang#136411 (Omit argument names from function pointers that do not have argument names)
 - rust-lang#136430 (Use the type-level constant value `ty::Value` where needed)
 - rust-lang#136476 (Remove generic `//@ ignore-{wasm,wasm32,emscripten}` in tests)
 - rust-lang#136484 (Notes on types/traits used for in-memory query caching)
 - rust-lang#136493 (platform-support: document CPU baseline for x86-32 targets)
 - rust-lang#136498 (Update books)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 2c6c7f8 into rust-lang:master Feb 4, 2025
6 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Feb 4, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 4, 2025
Rollup merge of rust-lang#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">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants