core: Remove use of deprecated drop
This commit is contained in:
parent
89f419370c
commit
5d79f94a2f
2 changed files with 6 additions and 4 deletions
|
@ -63,7 +63,6 @@ they contained the following prologue:
|
||||||
#[warn(vecs_implicitly_copyable)];
|
#[warn(vecs_implicitly_copyable)];
|
||||||
#[deny(non_camel_case_types)];
|
#[deny(non_camel_case_types)];
|
||||||
#[allow(deprecated_mutable_fields)];
|
#[allow(deprecated_mutable_fields)];
|
||||||
#[allow(deprecated_drop)];
|
|
||||||
|
|
||||||
// Make core testable by not duplicating lang items. See #2912
|
// Make core testable by not duplicating lang items. See #2912
|
||||||
#[cfg(test)] extern mod realcore(name = "core", vers = "0.7-pre");
|
#[cfg(test)] extern mod realcore(name = "core", vers = "0.7-pre");
|
||||||
|
|
|
@ -86,6 +86,7 @@ use cast::{forget, transmute, transmute_copy};
|
||||||
use either::{Either, Left, Right};
|
use either::{Either, Left, Right};
|
||||||
use kinds::Owned;
|
use kinds::Owned;
|
||||||
use libc;
|
use libc;
|
||||||
|
use ops::Drop;
|
||||||
use option::{None, Option, Some};
|
use option::{None, Option, Some};
|
||||||
use unstable::intrinsics;
|
use unstable::intrinsics;
|
||||||
use ptr;
|
use ptr;
|
||||||
|
@ -395,11 +396,13 @@ pub fn try_recv<T:Owned,Tbuffer:Owned>(p: RecvPacketBuffered<T, Tbuffer>)
|
||||||
let p_ = p.unwrap();
|
let p_ = p.unwrap();
|
||||||
let p = unsafe { &*p_ };
|
let p = unsafe { &*p_ };
|
||||||
|
|
||||||
#[unsafe_destructor]
|
|
||||||
struct DropState<'self> {
|
struct DropState<'self> {
|
||||||
p: &'self PacketHeader,
|
p: &'self PacketHeader,
|
||||||
|
}
|
||||||
|
|
||||||
drop {
|
#[unsafe_destructor]
|
||||||
|
impl<'self> Drop for DropState<'self> {
|
||||||
|
fn finalize(&self) {
|
||||||
unsafe {
|
unsafe {
|
||||||
if task::failing() {
|
if task::failing() {
|
||||||
self.p.state = Terminated;
|
self.p.state = Terminated;
|
||||||
|
@ -411,7 +414,7 @@ pub fn try_recv<T:Owned,Tbuffer:Owned>(p: RecvPacketBuffered<T, Tbuffer>)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
let _drop_state = DropState { p: &p.header };
|
let _drop_state = DropState { p: &p.header };
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue