-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Improve presentation of closure signature mismatch from Fn
trait goal
#139515
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,8 @@ LL | take(f) | |
| | | ||
| required by a bound introduced by this call | ||
| | ||
= note: expected a closure with arguments `(u32,)` | ||
found a closure with arguments `(i32,)` | ||
= note: expected a closure with signature `fn(i32)` | ||
found a closure with signature `fn(u32)` | ||
note: required by a bound in `take` | ||
--> $DIR/mismatch-fn-trait.rs:1:18 | ||
| | ||
|
@@ -68,8 +68,8 @@ LL | take(f) | |
| required by a bound introduced by this call | ||
| | ||
= note: `impl FnOnce(u32)` implements `FnOnce`, but it must implement `FnMut`, which is more general | ||
= note: expected a closure with arguments `(u32,)` | ||
found a closure with arguments `(i32,)` | ||
= note: expected a closure with signature `fn(i32)` | ||
found a closure with signature `fn(u32)` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why does this talk about closures for opaque types? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because whoever implemented the diagnostic note originally hard-coded "closure" here rather than using the sort string of the type or whatever. |
||
note: required by a bound in `take` | ||
--> $DIR/mismatch-fn-trait.rs:1:18 | ||
| | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing normalization with the new solver. idk where to best put it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this will need to be fixed separately. Definitely orthogonal to this PR.