]> git.lizzy.rs Git - rust.git/commitdiff
Tag a bunch of destructors that need mutable self with FIXME for #4330. Close #4943.
authorBen Blum <bblum@andrew.cmu.edu>
Mon, 10 Jun 2013 22:18:04 +0000 (18:18 -0400)
committerBen Blum <bblum@andrew.cmu.edu>
Mon, 10 Jun 2013 22:18:04 +0000 (18:18 -0400)
src/libstd/pipes.rs
src/libstd/rt/rc.rs
src/libstd/run.rs
src/libstd/task/spawn.rs
src/libstd/unstable/atomics.rs

index 1137540ae706145899ed36cd480f1a47c2c46f87..012ad0ed80d269d6bb36262469a3a0826f9018d1 100644 (file)
@@ -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);
index 1c0c8c14fdfa6404fa2be80abf552c6a55b26ef8..2977d081508122690c3449b197860c4b6ade7273 100644 (file)
@@ -78,7 +78,7 @@ fn finalize(&self) {
         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() {
index 41bc573f10d3f3cdbe309100efb6394292d8e7a2..85015c9bc5e41f511f8859c7469cdf30a0aec35d 100644 (file)
@@ -429,7 +429,7 @@ fn killpid(pid: pid_t, force: bool) {
 
 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();
index 87e9296657f48b62365731cb79593f5349ed9720..bc409e066330b69a5bfc0177232887f4f3cdacb7 100644 (file)
@@ -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.
index 58d0c01f990d047bf686e068b3c1c91c32aa6fdf..856f4e6e3c196163a4abafe80538730075affde0 100644 (file)
@@ -275,6 +275,7 @@ fn finalize(&self) {
         // 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);
         }