Skip to content

Tweak wording of "expected/found signature" errors - #164190

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
estebank:fn-signatures
Oct 13, 2026
Merged

rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
estebank:fn-signatures

Conversation

@estebank

Copy link
Copy Markdown
Contributor

Do not incorrectly state that we expected a closure when we expected anything that conforms to an Fn* trait.

Modify `on_unimplemented` attribute wording for `Fn*` traits.
@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. T-libs Relevant to the library team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Oct 12, 2026
@rustbot

rustbot commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator

r? @chenyukang

rustbot has assigned @chenyukang.
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
  • compiler expanded to 77 candidates
  • Random selection from 19 candidates

@estebank

Copy link
Copy Markdown
Contributor Author

Noticed while looking at #97010.

@chenyukang

Copy link
Copy Markdown
Member

@bors r+

@rust-bors

rust-bors Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 2c1f6b7 has been tentatively approved by chenyukang

It will be put into the queue for this repository once PR CI succeeds.

@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 Oct 12, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 12, 2026
@rust-bors

rust-bors Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

❌ Commit 2c1f6b7 has been unapproved due to PR CI failure. Reapprove it with @bors r+ force if you want to ignore the failure.

```
error[E0277]: expected `Fn(<_ as ATC<'a>>::Type)` signature, found `F`
  --> $DIR/issue-62529-3.rs:25:14
   |
LL |         call(f, ());
   |         ---- ^ expected `Fn(<_ as ATC<'a>>::Type)` signature, found `F`
   |         |
   |         required by a bound introduced by this call
   |
   = note:        expected type with signature `for<'a> fn(<_ as ATC<'a>>::Type)`
           found type parameter with signature `fn(())`
note: required by a bound in `call`
  --> $DIR/issue-62529-3.rs:9:36
   |
LL | fn call<'b, T: for<'a> ATC<'a>, F: for<'a> Fn(<T as ATC<'a>>::Type)>(
   |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `call`
```
@estebank

Copy link
Copy Markdown
Contributor Author

@bors r=chenyukang

@rust-bors

rust-bors Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

📌 Commit dc2da07 has been approved by chenyukang

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 12, 2026
rust-bors Bot pushed a commit that referenced this pull request Oct 12, 2026
Rollup of 7 pull requests

Successful merges:

 - #163798 (validate generic parameter remapping in delegation)
 - #164134 (bootstrap: add an rpath to LLVM library for LLVM tools)
 - #164190 (Tweak wording of "expected/found signature" errors)
 - #163578 (Add internal #[rustc_assert_variance] attribute for use in std)
 - #164126 (tests: Ignore dynamic-loading-cdylib on musl hosts)
 - #164171 (More `tests/rustdoc-html` cleanups)
 - #164221 (tests: cover `dead_code_pub_in_binary` expectations with `--test`)
@rust-bors
rust-bors Bot merged commit 881bfb6 into rust-lang:main Oct 13, 2026
14 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Oct 13, 2026
rust-bors Bot pushed a commit that referenced this pull request Oct 13, 2026
Rollup merge of #164190 - estebank:fn-signatures, r=chenyukang

Tweak wording of "expected/found signature" errors

Do not incorrectly state that we expected a closure when we expected *anything* that conforms to an `Fn*` trait.
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-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants