-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Introduce coerce_container_to_any #14812
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
Conversation
|
r? llogiq |
|
This looks good for a start. Let's add the documentation and replace the |
9950e08 to
2363e9d
Compare
|
Thanks to guidance from @y21 on Zulip, I've got this as smart as I wanted. Seeking feedback particularly on lint name and description wording. I may iterate on the diagnostic a little more. |
2363e9d to
18d86b3
Compare
|
Diagnostic is now pretty good. Not sure if there's a better way to format the expression type, e.g. so it shows up as |
4438e38 to
037945c
Compare
|
Future work: maybe this should also fire on coercing |
This comment has been minimized.
This comment has been minimized.
fa326e3 to
71bc081
Compare
|
Thanks to @fu5ha for expanded docs! |
71bc081 to
eef8a8c
Compare
sanbox-irl
left a comment
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 looks wonderful! I left some bikeshedding comments on the description and what not.
For the name, what about coerce_container_to_any? I think using any_ref to describe &Box<dyn Any> is surprising
That would be path trimming, which we currently don't have. I'm on that, but you don't need to worry about it right now. |
eef8a8c to
27eec99
Compare
|
Applied all feedback. Thanks for the reviews! |
|
@llogiq friendly ping |
llogiq
left a comment
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.
I have one final suggestion regarding the lint message and will start the FCP soon.
7bde47c to
be982e8
Compare
|
The final comment period is on. |
be982e8 to
7e69dab
Compare
|
Fixed a stray ` in the example. |
This comment has been minimized.
This comment has been minimized.
7e69dab to
b51e737
Compare
|
Thank you! |
This PR introduces a lint which detects when
&Box<dyn Any>is coerced to&dyn Any, which is usually a mistake where the intent was to directly pass thedyn Anyinside the box without coercion.cc @llogiq
Remaining work:
Deref<Target=dyn Any>changelog: add [
coerce_container_to_any] lint