Skip to content

Commit

Permalink
Rollup merge of #22787 - pnkfelix:reenable-gate-for-unsafe_no_drop_fl…
Browse files Browse the repository at this point in the history
…ag, r=alexcrichton

 Turn `unsafe_no_drop_flag` back into a gated-feature.

Fix #22173
  • Loading branch information
Manishearth committed Feb 25, 2015
2 parents d3ee8d3 + 416daac commit bb827aa
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/libsyntax/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,9 @@ pub static KNOWN_ATTRIBUTES: &'static [(&'static str, AttributeType)] = &[
("static_assert", Whitelisted),
("no_debug", Whitelisted),
("omit_gdb_pretty_printer_section", Whitelisted),
("unsafe_no_drop_flag", Whitelisted),
("unsafe_no_drop_flag", Gated("unsafe_no_drop_flag",
"unsafe_no_drop_flag has unstable semantics \
and may be removed in the future")),

// used in resolve
("prelude_import", Whitelisted),
Expand Down
23 changes: 23 additions & 0 deletions src/test/compile-fail/unsafe_no_drop_flag-gate.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

pub struct T;

#[unsafe_no_drop_flag]
//~^ ERROR unsafe_no_drop_flag has unstable semantics and may be removed
pub struct S {
pub x: T,
}

impl Drop for S {
fn drop(&mut self) {}
}

pub fn main() {}

0 comments on commit bb827aa

Please sign in to comment.