Skip to content

Fix reversed argument counts in Fn trait mismatch note - #166646

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
bardiharborow:fix-fn-trait-arg-count-note
Nov 27, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
bardiharborow:fix-fn-trait-arg-count-note

Conversation

@bardiharborow

@bardiharborow bardiharborow commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

The "expected a closure taking N arguments, but one taking M arguments was given" note passed the callable's actual argument count where the expected count belongs, and vice versa.

Fixes #166645

@rustbot label +A-diagnostics +D-incorrect

The "expected a closure taking N arguments, but one taking M arguments
was given" note passed the callable's actual argument count where the
expected count belongs, and vice versa.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 27, 2026
@rustbot

rustbot commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

r? @mati865

rustbot has assigned @mati865.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler, types
  • compiler, types expanded to 79 candidates
  • Random selection from 21 candidates

@rustbot rustbot added A-diagnostics Area: Messages for errors, warnings, and lints D-incorrect Diagnostics: A diagnostic that is giving misleading or incorrect information. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Nov 27, 2026

@JonathanBrouwer JonathanBrouwer left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@rust-bors

rust-bors Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

📌 Commit a45ae67 has been approved by JonathanBrouwer

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Nov 27, 2026
@bardiharborow

Copy link
Copy Markdown
Contributor Author

@rustbot label -WG-trait-system-refactor

@rustbot rustbot removed the WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) label Nov 27, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 27, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - #165836 (Use LLVM option `-disable-auto-upgrade-debug-info`)
 - #164783 (callconv: mips64: match gcc for "alignment" of 16-byte-aligned ZSTs)
 - #166634 (do not lint `drop_bounds`, `dyn_drop`, `trivial_bounds` and const param names on items from external macros)
 - #166649 (abby dsl: minor refactor/cleanup)
 - #164628 (callconv: mips64: handle repr(transparent))
 - #166387 (Remove diagnostics import list)
 - #166564 (miri: support statx syscall)
 - #166583 (abby dsl tests: the passing test should check-pass)
 - #166595 (specify target CPUs in 'powerpc-types.rs' assembly test)
 - #166640 (compiletest: Use an explicit argfile instead of ArgFileCommand)
 - #166646 (Fix reversed argument counts in Fn trait mismatch note)
@rust-bors
rust-bors Bot merged commit 5993bf2 into rust-lang:main Nov 27, 2026
14 checks passed
@rustbot rustbot added this to the 1.102.0 milestone Nov 27, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 27, 2026
Rollup merge of #166646 - bardiharborow:fix-fn-trait-arg-count-note, r=JonathanBrouwer

Fix reversed argument counts in Fn trait mismatch note

The "expected a closure taking N arguments, but one taking M arguments was given" note passed the callable's actual argument count where the expected count belongs, and vice versa.
@bardiharborow
bardiharborow deleted the fix-fn-trait-arg-count-note branch November 28, 2026 08:37
mehmettoplu-rs pushed a commit to mehmettoplu-rs/miri that referenced this pull request Nov 28, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#165836 (Use LLVM option `-disable-auto-upgrade-debug-info`)
 - rust-lang/rust#164783 (callconv: mips64: match gcc for "alignment" of 16-byte-aligned ZSTs)
 - rust-lang/rust#166634 (do not lint `drop_bounds`, `dyn_drop`, `trivial_bounds` and const param names on items from external macros)
 - rust-lang/rust#166649 (abby dsl: minor refactor/cleanup)
 - rust-lang/rust#164628 (callconv: mips64: handle repr(transparent))
 - rust-lang/rust#166387 (Remove diagnostics import list)
 - rust-lang/rust#166564 (miri: support statx syscall)
 - rust-lang/rust#166583 (abby dsl tests: the passing test should check-pass)
 - rust-lang/rust#166595 (specify target CPUs in 'powerpc-types.rs' assembly test)
 - rust-lang/rust#166640 (compiletest: Use an explicit argfile instead of ArgFileCommand)
 - rust-lang/rust#166646 (Fix reversed argument counts in Fn trait mismatch note)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-diagnostics Area: Messages for errors, warnings, and lints D-incorrect Diagnostics: A diagnostic that is giving misleading or incorrect information. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fn trait mismatch note reports the expected and given argument counts the wrong way round

4 participants