-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Writing out a &Box<T>
type
#1480
Comments
I would like to give this a shot. Would this fit in the |
I went ahead and tried this on my own at scott-linder/rust-clippy@9afc8c933. I hope this is in the ballpark, and I look forward to feedback on it. |
looks okay to me! Might have been better to add a suggestion but it occurred to me that the suggestion can't be applied without changes elsewhere (to make the types match up) so I'm unsure if we should. Maybe we should, and differentiate with rust-lang/rust#39254 whenever that happens |
Awesome! Thank you for taking a look. I agree that the suggestion seems redundant in this case if it is not the full type, but I didn't know if it was possible to omit it. I also notice that this lint is behind |
You accidentally used |
Thank you, I pushed up the fix to the same branch. I believe that was the only other problem I noticed by myself; if you are happy with it I can open a PR, otherwise let me know what else could be changed (including any change or removal of the suggestion). |
yes, please do so. In the future you can open a PR even when you still have questions. Then we can discuss them directly on the PR. |
This issue applies to |
We already have a lint ( |
@mcarton Nice, thanks! |
Hi there, Say you have the following function signature, that retrieves a static boxed
In my current implementation, my
Is there some de-referencing magic that I need to do that I'm not understanding? Or did this lint not really consider the case of Trait Objects when it was added? How can I turn (Sorry if this is the wrong place for this discussion) |
Just |
(Thanks for the quick reply) |
Here's an example in a rust playground: https://play.rust-lang.org/?gist=c6fdcffae0287083315879ebd98e2207&version=nightly&mode=debug&edition=2015 |
You need to dereference twice if you start out with So |
That worked, thanks so much! |
any
&Box<T>
can also be a&T
, and&T
is much more general.I don't see any use in ever writing
&Box<T>
The text was updated successfully, but these errors were encountered: