mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
rollup merge of #22178: pnkfelix/featuregate-unsafe-no-drop-flag
Conflicts: src/libsyntax/feature_gate.rs
This commit is contained in:
commit
aa0db172de
@ -71,6 +71,7 @@
|
||||
#![feature(box_syntax)]
|
||||
#![feature(optin_builtin_traits)]
|
||||
#![feature(unboxed_closures)]
|
||||
#![feature(unsafe_no_drop_flag)]
|
||||
#![feature(core)]
|
||||
#![feature(hash)]
|
||||
#![cfg_attr(all(not(feature = "external_funcs"), not(feature = "external_crate")),
|
||||
|
@ -27,10 +27,12 @@
|
||||
#![feature(box_patterns)]
|
||||
#![feature(core)]
|
||||
#![feature(hash)]
|
||||
#![feature(slicing_syntax)]
|
||||
#![feature(staged_api)]
|
||||
#![feature(unboxed_closures)]
|
||||
#![feature(unicode)]
|
||||
#![feature(unsafe_destructor, slicing_syntax)]
|
||||
#![feature(unsafe_destructor)]
|
||||
#![feature(unsafe_no_drop_flag)]
|
||||
#![cfg_attr(test, feature(rand, rustc_private, test))]
|
||||
#![cfg_attr(test, allow(deprecated))] // rand
|
||||
|
||||
|
@ -111,7 +111,7 @@
|
||||
#![feature(core)]
|
||||
#![feature(hash)]
|
||||
#![feature(int_uint)]
|
||||
#![feature(lang_items, unsafe_destructor)]
|
||||
#![feature(lang_items)]
|
||||
#![feature(libc)]
|
||||
#![feature(linkage, thread_local, asm)]
|
||||
#![feature(old_impl_check)]
|
||||
@ -120,6 +120,8 @@
|
||||
#![feature(staged_api)]
|
||||
#![feature(unboxed_closures)]
|
||||
#![feature(unicode)]
|
||||
#![feature(unsafe_destructor)]
|
||||
#![feature(unsafe_no_drop_flag)]
|
||||
#![feature(macro_reexport)]
|
||||
#![cfg_attr(test, feature(test))]
|
||||
|
||||
|
@ -129,6 +129,10 @@ static KNOWN_FEATURES: &'static [(&'static str, &'static str, Status)] = &[
|
||||
|
||||
// Allows using `box` in patterns; RFC 469
|
||||
("box_patterns", "1.0.0", Active),
|
||||
|
||||
// Allows using the unsafe_no_drop_flag attribute (unlikely to
|
||||
// switch to Accepted; see RFC 320)
|
||||
("unsafe_no_drop_flag", "1.0.0", Active),
|
||||
];
|
||||
|
||||
enum Status {
|
||||
@ -477,6 +481,12 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> {
|
||||
self.gate_feature("no_std", attr.span,
|
||||
"no_std is experimental");
|
||||
}
|
||||
|
||||
if attr.check_name("unsafe_no_drop_flag") {
|
||||
self.gate_feature("unsafe_no_drop_flag", attr.span,
|
||||
"unsafe_no_drop_flag has unstable semantics \
|
||||
and may be removed in the future");
|
||||
}
|
||||
}
|
||||
|
||||
fn visit_pat(&mut self, pattern: &ast::Pat) {
|
||||
|
@ -8,6 +8,8 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(unsafe_no_drop_flag)]
|
||||
|
||||
#[unsafe_no_drop_flag]
|
||||
pub struct ZeroLengthThingWithDestructor;
|
||||
impl Drop for ZeroLengthThingWithDestructor {
|
||||
|
@ -9,6 +9,7 @@
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(unsafe_destructor)]
|
||||
#![feature(unsafe_no_drop_flag)]
|
||||
|
||||
use std::mem::size_of;
|
||||
|
||||
|
@ -8,6 +8,8 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(unsafe_no_drop_flag)]
|
||||
|
||||
static mut drop_count: uint = 0;
|
||||
|
||||
#[unsafe_no_drop_flag]
|
||||
|
@ -8,6 +8,8 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(unsafe_no_drop_flag)]
|
||||
|
||||
static mut destructions : int = 3;
|
||||
|
||||
pub fn foo() {
|
||||
|
Loading…
Reference in New Issue
Block a user