Skip to content

Commit d188f2a

Browse files
committed
---
yaml --- r: 80633 b: refs/heads/auto c: befc561 h: refs/heads/master i: 80631: b295d8d v: v3
1 parent c07ea67 commit d188f2a

File tree

6 files changed

+19
-39
lines changed

6 files changed

+19
-39
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 72e7c62ec4ecddadeccb928ac488a8715d80aef7
16+
refs/heads/auto: befc561fa4f76b058fc4d9d14f7ed508df0cb272
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/libextra/workcache.rs

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

201-
// FIXME #4330: use &mut self here
202201
#[unsafe_destructor]
203202
impl Drop for Database {
204203
fn drop(&mut self) {

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

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

8080
unsafe {
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() {
81+
match *self.get_mut_state() {
8582
(ref mut count, _) => {
8683
*count = *count - 1
8784
}
8885
}
8986

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

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

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

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

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

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

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

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

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -339,13 +339,7 @@ impl<T> AtomicOption<T> {
339339
#[unsafe_destructor]
340340
impl<T> Drop for AtomicOption<T> {
341341
fn drop(&mut self) {
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-
}
342+
let _ = self.take(SeqCst);
349343
}
350344
}
351345

branches/auto/src/libsyntax/ext/bytes.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,43 +30,43 @@ pub fn expand_syntax_ext(cx: @ExtCtxt, sp: Span, tts: &[ast::token_tree]) -> bas
3030
// string literal, push each byte to vector expression
3131
ast::lit_str(s) => {
3232
for byte in s.byte_iter() {
33-
bytes.push(cx.expr_u8(expr.span, byte));
33+
bytes.push(cx.expr_u8(sp, byte));
3434
}
3535
}
3636

3737
// u8 literal, push to vector expression
3838
ast::lit_uint(v, ast::ty_u8) => {
3939
if v > 0xFF {
40-
cx.span_err(expr.span, "Too large u8 literal in bytes!")
40+
cx.span_err(sp, "Too large u8 literal in bytes!")
4141
} else {
42-
bytes.push(cx.expr_u8(expr.span, v as u8));
42+
bytes.push(cx.expr_u8(sp, v as u8));
4343
}
4444
}
4545

4646
// integer literal, push to vector expression
4747
ast::lit_int_unsuffixed(v) => {
4848
if v > 0xFF {
49-
cx.span_err(expr.span, "Too large integer literal in bytes!")
49+
cx.span_err(sp, "Too large integer literal in bytes!")
5050
} else if v < 0 {
51-
cx.span_err(expr.span, "Negative integer literal in bytes!")
51+
cx.span_err(sp, "Negative integer literal in bytes!")
5252
} else {
53-
bytes.push(cx.expr_u8(expr.span, v as u8));
53+
bytes.push(cx.expr_u8(sp, v as u8));
5454
}
5555
}
5656

5757
// char literal, push to vector expression
5858
ast::lit_char(v) => {
5959
if char::from_u32(v).unwrap().is_ascii() {
60-
bytes.push(cx.expr_u8(expr.span, v as u8));
60+
bytes.push(cx.expr_u8(sp, v as u8));
6161
} else {
62-
cx.span_err(expr.span, "Non-ascii char literal in bytes!")
62+
cx.span_err(sp, "Non-ascii char literal in bytes!")
6363
}
6464
}
6565

66-
_ => cx.span_err(expr.span, "Unsupported literal in bytes!")
66+
_ => cx.span_err(sp, "Unsupported literal in bytes!")
6767
},
6868

69-
_ => cx.span_err(expr.span, "Non-literal in bytes!")
69+
_ => cx.span_err(sp, "Non-literal in bytes!")
7070
}
7171
}
7272

0 commit comments

Comments
 (0)