-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
.into()
suggested in const context
#49100
Comments
We have so many cases of these in clippy... we should figure out a way to generalize not producing lints or suggestions in certain contexts |
I originally wrote the code to suggest As for the generalization, I'd be surprised if we can come up with a way to avoid needing all this context when writing lints, sadly. |
We can ask for the AST parent until we hit an item and then check for const or const fn. But I don't know how to nicely create an API for that |
Do not suggest `.into()` in `const`s Fix rust-lang#49100.
The compiler suggests
.into()
instead of anas
-cast:Normally I'm all about phasing out
as
, and we should somehow make.into()
callable on consts, but right now it's suggesting invalid code.cc @estebank (implemented #47247)
The text was updated successfully, but these errors were encountered: