-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Suggest borrowing when it would satisfy an unmet trait bound #65456
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
| ^^^^^^^ | ||
| | | ||
| expected an `FnMut<(char,)>` closure, found `std::string::String` | ||
| help: consider borrowing here: `&pattern` |
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.
This is the particular common case (std::str::pattern::Pattern
) that is encountered often by newcomers and this PR is meant to solve.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
99bf5dc
to
dc00b1a
Compare
This comment has been minimized.
This comment has been minimized.
dc00b1a
to
6f0731e
Compare
CC @Centril in case you're interested in this. |
.stderr diffs look good but the code is alien to me :) |
This comment has been minimized.
This comment has been minimized.
6f0731e
to
001295b
Compare
ping @matthewjasper |
@bors r+ |
📌 Commit 001295beefad4b250b2d940fc1e023d1894bad18 has been approved by |
This comment has been minimized.
This comment has been minimized.
8970e3a
to
85d7ff6
Compare
@bors r=matthewjasper |
📌 Commit 85d7ff6 has been approved by |
85d7ff6
to
e5e3c52
Compare
@bors r=matthewjasper |
📌 Commit e5e3c52e9e6561ff33184b4fe17adc2dbc071fe4 has been approved by |
☔ The latest upstream changes (presumably #66453) made this pull request unmergeable. Please resolve the merge conflicts. |
@bors r- |
When there are multiple implementors for the same trait that is present in an unmet binding, modify the E0277 error to refer to the parent obligation and verify whether borrowing the argument being passed in would satisfy the unmet bound. If it would, suggest it.
e5e3c52
to
5c5cbc0
Compare
This comment has been minimized.
This comment has been minimized.
5c5cbc0
to
2fe8371
Compare
@bors r=matthewjasper |
📌 Commit 2fe8371 has been approved by |
Suggest borrowing when it would satisfy an unmet trait bound When there are multiple implementors for the same trait that is present in an unmet binding, modify the E0277 error to refer to the parent obligation and verify whether borrowing the argument being passed in would satisfy the unmet bound. If it would, suggest it. Fix #56368.
☀️ Test successful - checks-azure |
Tested on commit rust-lang/rust@361791b. Direct link to PR: <rust-lang/rust#65456> 🎉 rustc-guide on linux: test-fail → test-pass (cc @amanjeev @spastorino @mark-i-m, @rust-lang/infra).
When there are multiple implementors for the same trait that is present
in an unmet binding, modify the E0277 error to refer to the parent
obligation and verify whether borrowing the argument being passed in
would satisfy the unmet bound. If it would, suggest it.
Fix #56368.