diff options
| author | Felix S. Klock II <pnkfelix@pnkfx.org> | 2014-10-27 12:57:14 +0100 |
|---|---|---|
| committer | Felix S. Klock II <pnkfelix@pnkfx.org> | 2015-03-29 00:19:19 +0100 |
| commit | 64c48f390ccd6410c02e96968a2cff187eeaf442 (patch) | |
| tree | b413cd7a13103b98149104160645a783009332dc /src/libsyntax | |
| parent | 01f2c67c966297279e42be5285ccae9f5b43703e (diff) | |
| download | rust-64c48f390ccd6410c02e96968a2cff187eeaf442.tar.gz rust-64c48f390ccd6410c02e96968a2cff187eeaf442.zip | |
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 (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).
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index c6e6e749860..1b03a180720 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -58,7 +58,6 @@ const KNOWN_FEATURES: &'static [(&'static str, &'static str, Status)] = &[ ("log_syntax", "1.0.0", Active), ("trace_macros", "1.0.0", Active), ("concat_idents", "1.0.0", Active), - ("unsafe_destructor", "1.0.0", Active), ("intrinsics", "1.0.0", Active), ("lang_items", "1.0.0", Active), @@ -92,6 +91,10 @@ const KNOWN_FEATURES: &'static [(&'static str, &'static str, Status)] = &[ ("start", "1.0.0", Active), ("main", "1.0.0", Active), + // Deprecate after snapshot + // SNAP a923278 + ("unsafe_destructor", "1.0.0", Active), + // A temporary feature gate used to enable parser extensions needed // to bootstrap fix for #5723. ("issue_5723_bootstrap", "1.0.0", Accepted), @@ -193,7 +196,6 @@ pub const KNOWN_ATTRIBUTES: &'static [(&'static str, AttributeType)] = &[ ("repr", Normal), ("path", Normal), ("abi", Normal), - ("unsafe_destructor", Normal), ("automatically_derived", Normal), ("no_mangle", Normal), ("no_link", Normal), @@ -205,7 +207,8 @@ pub const KNOWN_ATTRIBUTES: &'static [(&'static str, AttributeType)] = &[ ("link_args", Normal), ("macro_escape", Normal), - + ("unsafe_destructor", Gated("unsafe_destructor", + "`#[unsafe_destructor]` does nothing anymore")), ("staged_api", Gated("staged_api", "staged_api is for use by rustc only")), ("plugin", Gated("plugin", @@ -571,15 +574,6 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> { _ => {} } - if attr::contains_name(&i.attrs, - "unsafe_destructor") { - self.gate_feature("unsafe_destructor", - i.span, - "`#[unsafe_destructor]` allows too \ - many unsafe patterns and may be \ - removed in the future"); - } - if attr::contains_name(&i.attrs[..], "old_orphan_check") { self.gate_feature( |
