-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Once confident in dropck: remove #[unsafe_destructor]
attribute
#22196
Comments
Nominating; we should decide whether we are going to do this for 1.0 beta, or if it can wait until the 1.0 release itself as a "polish issue." (or if it can wait even beyond that, i.e. to 1.x. But I am not advocating that position.) (However, given that #21972 just landed today, it may be a good idea to let the code settle for a week before we actually make a decision about this. Its super easy to remove |
#[unsafe_destructor]
attribute#[unsafe_destructor]
attribute
1.0 beta, P-high. |
@SSheldon I'm going to try, but I don't know if I'll be able to do everything necessary to unfeature gate it by the beta. We will see, I'm reviewing the remaining tasks now. |
@pnkfelix, thanks! For what it's worth, I was able to remove the |
If you can't unfeature gate the entire unsafe_destructor, would it be possible to only unfeature gate those Drop impls we're confident with? Like, the simple and obvious ones (for various values of "simple" and "obvious" :-) ). I suspect a majority of Drop impls would be simple and obvious. |
at this point I have a patch for the main known issue : PR #23638. An audit of |
Earlier commits impose rules on lifetimes that make generic destructors safe; thus we no longer need the `#[unsafe_destructor]` attribute nor its associated check. ---- So remove the check for the unsafe_destructor attribute. And remove outdated compile-fail tests from when lifetime-parameteric dtors were disallowed/unsafe. In addition, when one uses the attribute without the associated feature, report that the attribute is deprecated. However, I do not think this is a breaking-change, because the attribute and feature are still currently accepted by the compiler. (After the next snapshot that has this commit, we can remove the feature itself and the attribute as well.) ---- I consider this to: Fix rust-lang#22196 (techincally there is still the post snapshot work of removing the last remants of the feature and the attribute, but the ticket can still be closed in my opinion).
Port of pcwalton removal of `#[unsafe_destructor]` check. Earlier commits impose rules on lifetimes that make generic destructors safe; thus we no longer need the `#[unsafe_destructor]` attribute nor its associated check. ---- So remove the check for the unsafe_destructor attribute. And remove outdated compile-fail tests from when lifetime-parameteric dtors were disallowed/unsafe. In addition, when one uses the attribute without the associated feature, report that the attribute is deprecated. However, I do not think this is a breaking-change, because the attribute and feature are still currently accepted by the compiler. (After the next snapshot that has this commit, we can remove the feature itself and the attribute as well.) ---- I consider this to: Fix #22196 (technically there is still the post snapshot work of removing the last remnants of the feature and the attribute, but the ticket can still be closed in my opinion).
Spawned off of #8861, this is the last step in RFC #769, Sound Generic Drop.
Basically, once we are relatively confident that:
dropck
code is at least a sound approximation of that rule, andthen we should remove the
#[unsafe_destructor]
attribute and all the uses of it.The text was updated successfully, but these errors were encountered: