Improve presentation of closure signature mismatch from Fn trait goal#139515
Merged
bors merged 2 commits intorust-lang:masterfrom Apr 9, 2025
Merged
Improve presentation of closure signature mismatch from Fn trait goal#139515bors merged 2 commits intorust-lang:masterfrom
Fn trait goal#139515bors merged 2 commits intorust-lang:masterfrom
Conversation
lcnr
reviewed
Apr 8, 2025
| = help: the trait `for<'a> FnMut(&'a <std::ops::RangeInclusive<{integer}> as Iterator>::Item)` is not implemented for closure `{closure@$DIR/closure-arg-type-mismatch-issue-45727.rs:6:29: 6:37}` | ||
| = note: expected a closure with arguments `(i32,)` | ||
| found a closure with arguments `(&<std::ops::RangeInclusive<{integer}> as Iterator>::Item,)` | ||
| = note: expected a closure with signature `for<'a> fn(&'a <std::ops::RangeInclusive<{integer}> as Iterator>::Item)` |
Contributor
There was a problem hiding this comment.
missing normalization with the new solver. idk where to best put it
Contributor
Author
There was a problem hiding this comment.
Yeah, this will need to be fixed separately. Definitely orthogonal to this PR.
lcnr
reviewed
Apr 8, 2025
| = 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)` |
Contributor
There was a problem hiding this comment.
why does this talk about closures for opaque types?
Contributor
Author
There was a problem hiding this comment.
Because whoever implemented the diagnostic note originally hard-coded "closure" here rather than using the sort string of the type or whatever.
Contributor
|
would be great to fix these 2 issues separately @bors r+ rollup |
Collaborator
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Apr 8, 2025
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#139494 (Restrict some queries by def-kind more) - rust-lang#139496 (Revert r-a changes of rust-lang#139455) - rust-lang#139506 (add missing word in doc comment (part 2)) - rust-lang#139515 (Improve presentation of closure signature mismatch from `Fn` trait goal) - rust-lang#139520 (compiletest maintenance: sort deps and drop dep on `anyhow`) - rust-lang#139523 (Rustc dev guide subtree update) - rust-lang#139526 (Fix deprecation note for std::intrinsics) - rust-lang#139528 (compiletest: Remove the `--logfile` flag) - rust-lang#139541 (Instantiate higher-ranked transmute goal w/ placeholders before emitting sub-obligations) - rust-lang#139547 (Update library tracking issue template to set S-tracking-unimplemented) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Apr 9, 2025
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#139494 (Restrict some queries by def-kind more) - rust-lang#139496 (Revert r-a changes of rust-lang#139455) - rust-lang#139506 (add missing word in doc comment (part 2)) - rust-lang#139515 (Improve presentation of closure signature mismatch from `Fn` trait goal) - rust-lang#139520 (compiletest maintenance: sort deps and drop dep on `anyhow`) - rust-lang#139523 (Rustc dev guide subtree update) - rust-lang#139526 (Fix deprecation note for std::intrinsics) - rust-lang#139528 (compiletest: Remove the `--logfile` flag) - rust-lang#139541 (Instantiate higher-ranked transmute goal w/ placeholders before emitting sub-obligations) - rust-lang#139547 (Update library tracking issue template to set S-tracking-unimplemented) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Apr 9, 2025
Rollup merge of rust-lang#139515 - compiler-errors:sig-mismatch, r=lcnr Improve presentation of closure signature mismatch from `Fn` trait goal Flip the order of "expected" and "found" since that wasn't correct. Don't present the arguments as a tuple, since it leaves a trailing comma. Instead, just use `fn(arg, arg)`. Finally, be better with binders since we were just skipping binders. r? oli-obk or reassign
github-actions bot
pushed a commit
to model-checking/verify-rust-std
that referenced
this pull request
Apr 19, 2025
…iaskrgr Rollup of 10 pull requests Successful merges: - rust-lang#139494 (Restrict some queries by def-kind more) - rust-lang#139496 (Revert r-a changes of rust-lang#139455) - rust-lang#139506 (add missing word in doc comment (part 2)) - rust-lang#139515 (Improve presentation of closure signature mismatch from `Fn` trait goal) - rust-lang#139520 (compiletest maintenance: sort deps and drop dep on `anyhow`) - rust-lang#139523 (Rustc dev guide subtree update) - rust-lang#139526 (Fix deprecation note for std::intrinsics) - rust-lang#139528 (compiletest: Remove the `--logfile` flag) - rust-lang#139541 (Instantiate higher-ranked transmute goal w/ placeholders before emitting sub-obligations) - rust-lang#139547 (Update library tracking issue template to set S-tracking-unimplemented) r? `@ghost` `@rustbot` modify labels: rollup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Flip the order of "expected" and "found" since that wasn't correct.
Don't present the arguments as a tuple, since it leaves a trailing comma. Instead, just use
fn(arg, arg).Finally, be better with binders since we were just skipping binders.
r? oli-obk or reassign