Skip to content

Commit aa0db17

Browse files
committed
rollup merge of rust-lang#22178: pnkfelix/featuregate-unsafe-no-drop-flag
Conflicts: src/libsyntax/feature_gate.rs
2 parents 9492275 + f9a1087 commit aa0db17

File tree

8 files changed

+24
-2
lines changed

8 files changed

+24
-2
lines changed

src/liballoc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
#![feature(box_syntax)]
7272
#![feature(optin_builtin_traits)]
7373
#![feature(unboxed_closures)]
74+
#![feature(unsafe_no_drop_flag)]
7475
#![feature(core)]
7576
#![feature(hash)]
7677
#![cfg_attr(all(not(feature = "external_funcs"), not(feature = "external_crate")),

src/libcollections/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@
2727
#![feature(box_patterns)]
2828
#![feature(core)]
2929
#![feature(hash)]
30+
#![feature(slicing_syntax)]
3031
#![feature(staged_api)]
3132
#![feature(unboxed_closures)]
3233
#![feature(unicode)]
33-
#![feature(unsafe_destructor, slicing_syntax)]
34+
#![feature(unsafe_destructor)]
35+
#![feature(unsafe_no_drop_flag)]
3436
#![cfg_attr(test, feature(rand, rustc_private, test))]
3537
#![cfg_attr(test, allow(deprecated))] // rand
3638

src/libstd/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
#![feature(core)]
112112
#![feature(hash)]
113113
#![feature(int_uint)]
114-
#![feature(lang_items, unsafe_destructor)]
114+
#![feature(lang_items)]
115115
#![feature(libc)]
116116
#![feature(linkage, thread_local, asm)]
117117
#![feature(old_impl_check)]
@@ -120,6 +120,8 @@
120120
#![feature(staged_api)]
121121
#![feature(unboxed_closures)]
122122
#![feature(unicode)]
123+
#![feature(unsafe_destructor)]
124+
#![feature(unsafe_no_drop_flag)]
123125
#![feature(macro_reexport)]
124126
#![cfg_attr(test, feature(test))]
125127

src/libsyntax/feature_gate.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ static KNOWN_FEATURES: &'static [(&'static str, &'static str, Status)] = &[
129129

130130
// Allows using `box` in patterns; RFC 469
131131
("box_patterns", "1.0.0", Active),
132+
133+
// Allows using the unsafe_no_drop_flag attribute (unlikely to
134+
// switch to Accepted; see RFC 320)
135+
("unsafe_no_drop_flag", "1.0.0", Active),
132136
];
133137

134138
enum Status {
@@ -477,6 +481,12 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> {
477481
self.gate_feature("no_std", attr.span,
478482
"no_std is experimental");
479483
}
484+
485+
if attr.check_name("unsafe_no_drop_flag") {
486+
self.gate_feature("unsafe_no_drop_flag", attr.span,
487+
"unsafe_no_drop_flag has unstable semantics \
488+
and may be removed in the future");
489+
}
480490
}
481491

482492
fn visit_pat(&mut self, pattern: &ast::Pat) {

src/test/auxiliary/issue-10028.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![feature(unsafe_no_drop_flag)]
12+
1113
#[unsafe_no_drop_flag]
1214
pub struct ZeroLengthThingWithDestructor;
1315
impl Drop for ZeroLengthThingWithDestructor {

src/test/run-pass/attr-no-drop-flag-size.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
#![feature(unsafe_destructor)]
12+
#![feature(unsafe_no_drop_flag)]
1213

1314
use std::mem::size_of;
1415

src/test/run-pass/issue-10734.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![feature(unsafe_no_drop_flag)]
12+
1113
static mut drop_count: uint = 0;
1214

1315
#[unsafe_no_drop_flag]

src/test/run-pass/zero-size-type-destructors.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![feature(unsafe_no_drop_flag)]
12+
1113
static mut destructions : int = 3;
1214

1315
pub fn foo() {

0 commit comments

Comments
 (0)