librustc: Put #[unsafe_destructor] behind a feature gate.
Closes #8142. This is not the semantics we want long-term. You can continue to use `#[unsafe_destructor]`, but you'll need to add `#![feature(unsafe_destructor)]` to the crate attributes. [breaking-change]
This commit is contained in:
parent
6750eb5a05
commit
dcbf4ec2a1
36 changed files with 78 additions and 33 deletions
|
|
@ -50,6 +50,7 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
|
|||
("log_syntax", Active),
|
||||
("trace_macros", Active),
|
||||
("concat_idents", Active),
|
||||
("unsafe_destructor", Active),
|
||||
|
||||
("simd", Active),
|
||||
("default_type_params", Active),
|
||||
|
|
@ -220,6 +221,17 @@ impl<'a> Visitor<()> for Context<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
ast::ItemImpl(..) => {
|
||||
if attr::contains_name(i.attrs.as_slice(),
|
||||
"unsafe_destructor") {
|
||||
self.gate_feature("unsafe_destructor",
|
||||
i.span,
|
||||
"`#[unsafe_destructor]` allows too \
|
||||
many unsafe patterns and may be \
|
||||
removed in the future");
|
||||
}
|
||||
}
|
||||
|
||||
_ => {}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,8 +29,9 @@ This API is completely unstable and subject to change.
|
|||
html_root_url = "http://doc.rust-lang.org/")]
|
||||
|
||||
#![allow(deprecated)]
|
||||
#![feature(macro_rules, globs, struct_variant, managed_boxes, quote,
|
||||
default_type_params, phase)]
|
||||
#![allow(unknown_features)] // NOTE: remove after a stage0 snap
|
||||
#![feature(macro_rules, globs, struct_variant, managed_boxes, quote)]
|
||||
#![feature(default_type_params, phase, unsafe_destructor)]
|
||||
|
||||
extern crate arena;
|
||||
extern crate debug;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue