-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 diagnostics for E0120 #27220
Add diagnostics for E0120 #27220
Conversation
} | ||
``` | ||
|
||
Only structs are allowed to implement Drop. That being the case, a solution for |
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.
and enums
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.
Oops, good catch!
I think there are many use cases we should explore and give alternatives to:
|
Alright, I'll have a look at that tomorrow. |
I've had a stab at it, but would appreciate a review to make sure I'm going in the direction you were thinking of :-) |
|
||
``` | ||
trait MyTrait {} | ||
struct MyWrapper<'a> { foo: &'a MyTrait } |
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.
leave a comment // or Box<MyTrait>, if you wanted an owned trait object
looks good to me! |
b47be9e
to
e668175
Compare
Done, and squashed! |
@bors r+ rollup |
📌 Commit e668175 has been approved by |
…arth As title! I should probably be bunching these up a bit more, but I'm not sure when my time is going to disappear on me. Once my schedule stabilises I'll try to start batching them into larger PRs. Part of rust-lang#24407. r? @Manishearth
As title!
I should probably be bunching these up a bit more, but I'm not sure when my time is going to disappear on me. Once my schedule stabilises I'll try to start batching them into larger PRs.
Part of #24407.
r? @Manishearth