This commit is contained in:
@@ -315,6 +315,7 @@ struct BufferResource<T> {
|
|||||||
impl<T> Drop for BufferResource<T> {
|
impl<T> Drop for BufferResource<T> {
|
||||||
fn finalize(&self) {
|
fn finalize(&self) {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
// FIXME(#4330) Need self by value to get mutability.
|
||||||
let this: &mut BufferResource<T> = transmute(self);
|
let this: &mut BufferResource<T> = transmute(self);
|
||||||
|
|
||||||
let mut b = move_it!(this.buffer);
|
let mut b = move_it!(this.buffer);
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ impl<T> Drop for RC<T> {
|
|||||||
assert!(self.refcount() > 0);
|
assert!(self.refcount() > 0);
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
// XXX: Mutable finalizer
|
// FIXME(#4330) Need self by value to get mutability.
|
||||||
let this: &mut RC<T> = cast::transmute_mut(self);
|
let this: &mut RC<T> = cast::transmute_mut(self);
|
||||||
|
|
||||||
match *this.get_mut_state() {
|
match *this.get_mut_state() {
|
||||||
|
|||||||
@@ -429,7 +429,7 @@ impl Process {
|
|||||||
|
|
||||||
impl Drop for Process {
|
impl Drop for Process {
|
||||||
fn finalize(&self) {
|
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) };
|
let mut_self: &mut Process = unsafe { cast::transmute(self) };
|
||||||
|
|
||||||
mut_self.finish();
|
mut_self.finish();
|
||||||
|
|||||||
@@ -323,6 +323,7 @@ impl Drop for TCB {
|
|||||||
// Runs on task exit.
|
// Runs on task exit.
|
||||||
fn finalize(&self) {
|
fn finalize(&self) {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
// FIXME(#4330) Need self by value to get mutability.
|
||||||
let this: &mut TCB = transmute(self);
|
let this: &mut TCB = transmute(self);
|
||||||
|
|
||||||
// If we are failing, the whole taskgroup needs to die.
|
// 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
|
// This will ensure that the contained data is
|
||||||
// destroyed, unless it's null.
|
// destroyed, unless it's null.
|
||||||
unsafe {
|
unsafe {
|
||||||
|
// FIXME(#4330) Need self by value to get mutability.
|
||||||
let this : &mut AtomicOption<T> = cast::transmute(self);
|
let this : &mut AtomicOption<T> = cast::transmute(self);
|
||||||
let _ = this.take(SeqCst);
|
let _ = this.take(SeqCst);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user