-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Add suggest Vec::push when the wrong method is used #121029
Conversation
&& let Some(recv_ty) = finder.recv.and_then(|recv| typecheck.expr_ty_opt(recv)) | ||
&& let ty::Adt(def, _) = recv_ty.kind() | ||
&& def.did() == vec_def_id | ||
&& (recv_ty.contains(*found) || recv_ty.has_infer_types()) |
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.
maybe it's better to check coerce between recv_ty
and expected ty
?
While this suggestion is really precise and targeted, would it be sufficient to use cc #59450 |
Indeed it will be better to leverage
|
emm, the issue was not linked with a PR 😂 |
@chenyukang yeah, it's a shame we have some overlapping tickets that are not linked to each other leading to situations like this one :-/ |
Fixes #87212
append
is commonly used in Python, suggestpush
if possible.