Feature-gate the #[unsafe_no_drop_flag] attribute.
See RFC 320, "Non-zeroing dynamic drops." Fix #22173 [breaking-change]
This commit is contained in:
parent
0047f8bbd8
commit
f9a1087f27
8 changed files with 24 additions and 2 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue