Skip to content

Commit 5de0e37

Browse files
committed
---
yaml --- r: 83189 b: refs/heads/try c: aa406c1 h: refs/heads/master i: 83187: a5492e5 v: v3
1 parent a9ba89d commit 5de0e37

File tree

6 files changed

+30
-10
lines changed

6 files changed

+30
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 0e4d1fc8cae42e15e00f71d9f439b01bb25a86ae
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6c08cc2db4f98e9f07ae7d50338396c4123c2f0a
5-
refs/heads/try: 9e8fb4ad61cfe97413eb92d764aa6aeeb23d5afa
5+
refs/heads/try: aa406c151e7404029760e56338f9ebc92319a5d5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/libextra/workcache.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ impl Database {
198198
}
199199
}
200200

201+
// FIXME #4330: use &mut self here
201202
#[unsafe_destructor]
202203
impl Drop for Database {
203204
fn drop(&mut self) {

branches/try/src/libstd/rt/rc.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,17 @@ impl<T> Drop for RC<T> {
7878
assert!(self.refcount() > 0);
7979

8080
unsafe {
81-
match *self.get_mut_state() {
81+
// FIXME(#4330) Need self by value to get mutability.
82+
let this: &mut RC<T> = cast::transmute_mut(self);
83+
84+
match *this.get_mut_state() {
8285
(ref mut count, _) => {
8386
*count = *count - 1
8487
}
8588
}
8689

87-
if self.refcount() == 0 {
88-
let _: ~(uint, T) = cast::transmute(self.p);
90+
if this.refcount() == 0 {
91+
let _: ~(uint, T) = cast::transmute(this.p);
8992
}
9093
}
9194
}

branches/try/src/libstd/rt/uv/uvio.rs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,11 @@ impl UvEventLoop {
188188

189189
impl Drop for UvEventLoop {
190190
fn drop(&mut self) {
191-
self.uvio.uv_loop().close();
191+
// XXX: Need mutable finalizer
192+
let this = unsafe {
193+
transmute::<&UvEventLoop, &mut UvEventLoop>(self)
194+
};
195+
this.uvio.uv_loop().close();
192196
}
193197
}
194198

@@ -644,7 +648,9 @@ impl UvTcpListener {
644648

645649
impl Drop for UvTcpListener {
646650
fn drop(&mut self) {
647-
do self.home_for_io_with_sched |self_, scheduler| {
651+
// XXX need mutable finalizer
652+
let self_ = unsafe { transmute::<&UvTcpListener, &mut UvTcpListener>(self) };
653+
do self_.home_for_io_with_sched |self_, scheduler| {
648654
do scheduler.deschedule_running_task_and_then |_, task| {
649655
let task = Cell::new(task);
650656
do self_.watcher.as_stream().close {
@@ -757,7 +763,9 @@ impl HomingIO for UvTcpStream {
757763

758764
impl Drop for UvTcpStream {
759765
fn drop(&mut self) {
760-
do self.home_for_io_with_sched |self_, scheduler| {
766+
// XXX need mutable finalizer
767+
let this = unsafe { transmute::<&UvTcpStream, &mut UvTcpStream>(self) };
768+
do this.home_for_io_with_sched |self_, scheduler| {
761769
do scheduler.deschedule_running_task_and_then |_, task| {
762770
let task_cell = Cell::new(task);
763771
do self_.watcher.as_stream().close {
@@ -914,7 +922,9 @@ impl HomingIO for UvUdpSocket {
914922

915923
impl Drop for UvUdpSocket {
916924
fn drop(&mut self) {
917-
do self.home_for_io_with_sched |self_, scheduler| {
925+
// XXX need mutable finalizer
926+
let this = unsafe { transmute::<&UvUdpSocket, &mut UvUdpSocket>(self) };
927+
do this.home_for_io_with_sched |self_, scheduler| {
918928
do scheduler.deschedule_running_task_and_then |_, task| {
919929
let task_cell = Cell::new(task);
920930
do self_.watcher.close {

branches/try/src/libstd/unstable/atomics.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,13 @@ impl<T> AtomicOption<T> {
339339
#[unsafe_destructor]
340340
impl<T> Drop for AtomicOption<T> {
341341
fn drop(&mut self) {
342-
let _ = self.take(SeqCst);
342+
// This will ensure that the contained data is
343+
// destroyed, unless it's null.
344+
unsafe {
345+
// FIXME(#4330) Need self by value to get mutability.
346+
let this : &mut AtomicOption<T> = cast::transmute(self);
347+
let _ = this.take(SeqCst);
348+
}
343349
}
344350
}
345351

branches/try/src/libsyntax/print/pp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ pub fn mk_printer(out: @io::Writer, linewidth: uint) -> @mut Printer {
243243
* the entire buffered window, but can't output anything until the size is >=
244244
* 0 (sizes are set to negative while they're pending calculation).
245245
*
246-
* So SCAN takeks input and buffers tokens and pending calculations, while
246+
* So SCAN takes input and buffers tokens and pending calculations, while
247247
* PRINT gobbles up completed calculations and tokens from the buffer. The
248248
* theory is that the two can never get more than 3N tokens apart, because
249249
* once there's "obviously" too much data to fit on a line, in a size

0 commit comments

Comments
 (0)