mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-26 15:36:39 +00:00
This commit is contained in:
parent
d25fae0e10
commit
8081aea3b8
@ -315,6 +315,7 @@ struct BufferResource<T> {
|
||||
impl<T> Drop for BufferResource<T> {
|
||||
fn finalize(&self) {
|
||||
unsafe {
|
||||
// FIXME(#4330) Need self by value to get mutability.
|
||||
let this: &mut BufferResource<T> = transmute(self);
|
||||
|
||||
let mut b = move_it!(this.buffer);
|
||||
|
@ -78,7 +78,7 @@ impl<T> Drop for RC<T> {
|
||||
assert!(self.refcount() > 0);
|
||||
|
||||
unsafe {
|
||||
// XXX: Mutable finalizer
|
||||
// FIXME(#4330) Need self by value to get mutability.
|
||||
let this: &mut RC<T> = cast::transmute_mut(self);
|
||||
|
||||
match *this.get_mut_state() {
|
||||
|
@ -429,7 +429,7 @@ impl Process {
|
||||
|
||||
impl Drop for Process {
|
||||
fn finalize(&self) {
|
||||
// FIXME #4943: transmute is bad.
|
||||
// FIXME(#4330) Need self by value to get mutability.
|
||||
let mut_self: &mut Process = unsafe { cast::transmute(self) };
|
||||
|
||||
mut_self.finish();
|
||||
|
@ -323,6 +323,7 @@ impl Drop for TCB {
|
||||
// Runs on task exit.
|
||||
fn finalize(&self) {
|
||||
unsafe {
|
||||
// FIXME(#4330) Need self by value to get mutability.
|
||||
let this: &mut TCB = transmute(self);
|
||||
|
||||
// If we are failing, the whole taskgroup needs to die.
|
||||
|
@ -275,6 +275,7 @@ impl<T> Drop for AtomicOption<T> {
|
||||
// This will ensure that the contained data is
|
||||
// destroyed, unless it's null.
|
||||
unsafe {
|
||||
// FIXME(#4330) Need self by value to get mutability.
|
||||
let this : &mut AtomicOption<T> = cast::transmute(self);
|
||||
let _ = this.take(SeqCst);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user