-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Suggest adding Fn
bound when calling a generic parameter
#144193
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
base: master
Are you sure you want to change the base?
Conversation
r? @davidtwco rustbot has assigned @davidtwco. Use |
This comment has been minimized.
This comment has been minimized.
r? compiler-errors @bors r+ rollup |
CI is red (not just spellcheck) @bors r- |
oops :D |
9ff1376
to
4f25693
Compare
The suggestion here is valid, but since the return type is unknown ( @rustbot ready |
4f25693
to
a756da7
Compare
a756da7
to
6f1c20d
Compare
The goal of the PR is to provide this diagnostic hint:
I had to provide some input for
suggest_restricting_param_bound
, but I wasn't sure where to get the correspondingFn
trait for, because here it didn't seem like the code was already checking for trait impl matches, unlike e.g. incheck_overloaded_binop
, where the suggest function is also used. With the help of Claude, I managed to create the trait ref somehow, but I'm not at all sure if it's the right way to do (in particular aroundBinder::dummy
).The
suggest_restricting_param_bound
change is also super hacky - maybe there's a way to "attach" the associatedOutput
type to theFn
trait ref, so that we don't have to manually render the output type?