mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-28 01:34:21 +00:00
Rename #[no_drop_flag] to #[unsafe_no_drop_flag]
This commit is contained in:
parent
779ee2a2dd
commit
dcf1dc060a
@ -3904,7 +3904,7 @@ impl DtorKind {
|
||||
pub fn ty_dtor(cx: ctxt, struct_id: def_id) -> DtorKind {
|
||||
match cx.destructor_for_type.find(&struct_id) {
|
||||
Some(&method_def_id) => {
|
||||
let flag = !has_attr(cx, struct_id, "no_drop_flag");
|
||||
let flag = !has_attr(cx, struct_id, "unsafe_no_drop_flag");
|
||||
|
||||
TraitDtor(method_def_id, flag)
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ pub struct AtomicPtr<T> {
|
||||
/**
|
||||
* An owned atomic pointer. Ensures that only a single reference to the data is held at any time.
|
||||
*/
|
||||
#[no_drop_flag]
|
||||
#[unsafe_no_drop_flag]
|
||||
pub struct AtomicOption<T> {
|
||||
priv p: *mut c_void
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ pub fn replace<T>(dest: &mut T, mut src: T) -> T {
|
||||
|
||||
/// A non-copyable dummy type.
|
||||
#[deriving(Eq, TotalEq, Ord, TotalOrd)]
|
||||
#[no_drop_flag]
|
||||
#[unsafe_no_drop_flag]
|
||||
pub struct NonCopyable;
|
||||
|
||||
impl Drop for NonCopyable {
|
||||
@ -171,7 +171,7 @@ mod tests {
|
||||
fn test_noncopyable() {
|
||||
assert_eq!(size_of::<NonCopyable>(), 0);
|
||||
|
||||
// verify that `#[no_drop_flag]` works as intended on a zero-size struct
|
||||
// verify that `#[unsafe_no_drop_flag]` works as intended on a zero-size struct
|
||||
|
||||
static mut did_run: bool = false;
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
use std::sys::size_of;
|
||||
|
||||
#[no_drop_flag]
|
||||
#[unsafe_no_drop_flag]
|
||||
struct Test<T> {
|
||||
a: T
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user