-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
#[pinned_drop] is a silent no-op if (PinnedDrop) isn't added to #[pin_project] #179
Comments
taiki-e
added
A-drop
Area: #[pinned_drop] and Drop
C-bug
Category: related to a bug.
C-enhancement
Category: A new feature or an improvement for an existing one
labels
Jan 25, 2020
bors bot
added a commit
that referenced
this issue
Jan 27, 2020
180: Ensure that users cannot implement `PinnedDrop` without proper attr r=taiki-e a=Aaron1011 Fixes #179 Previously, it was possible to provide a `#[pinned_drop]` implementation without annotating the pin-projected type with `#[pin_project(PinnedDrop)]`. This would result in the `PinnedDrop` impl never being used, without any warnings or errors being emitted to the user. This commit makes us generate a dummy `PinnedDrop` impl if the user does not pass `PinnedDrop` as an argument to `#[pin_project]`. This dummy impl will conflict with any user-provided impl, ensuring that the user cannot accidentally a non-functional `PinnedDrop` impl. Co-authored-by: Aaron Hill <aa1ronham@gmail.com>
Published 0.4.8 which fixes this issue. |
Thanks! |
taiki-e
removed
the
C-enhancement
Category: A new feature or an improvement for an existing one
label
Jan 29, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you take the
#[pinned_drop]
example and remove the argument to#[pin_project]
, it compiles without warnings but doesn't actually run the PinnedDrop impl when dropping: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=a156327aa5ce88e290d1038cdff9df12It'd be nice if that somehow caused a compilation error!
The text was updated successfully, but these errors were encountered: