Skip to content

Commit f03f599

Browse files
committed
---
yaml --- r: 145195 b: refs/heads/try2 c: befc561 h: refs/heads/master i: 145193: d1df4f9 145191: 6485b53 v: v3
1 parent 5820d02 commit f03f599

File tree

9 files changed

+20
-63
lines changed

9 files changed

+20
-63
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 023aab453c53fdeee8a99da2766ba562b224785c
8+
refs/heads/try2: befc561fa4f76b058fc4d9d14f7ed508df0cb272
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/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/try2/src/librustpkg/rustpkg.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ pub trait CtxMethods {
189189
fn test(&self);
190190
fn uninstall(&self, _id: &str, _vers: Option<~str>);
191191
fn unprefer(&self, _id: &str, _vers: Option<~str>);
192-
fn init(&self);
193192
}
194193

195194
impl CtxMethods for BuildContext {
@@ -320,13 +319,6 @@ impl CtxMethods for BuildContext {
320319
"test" => {
321320
self.test();
322321
}
323-
"init" => {
324-
if args.len() != 0 {
325-
return usage::init();
326-
} else {
327-
self.init();
328-
}
329-
}
330322
"uninstall" => {
331323
if args.len() < 1 {
332324
return usage::uninstall();
@@ -548,13 +540,6 @@ impl CtxMethods for BuildContext {
548540
fail!("test not yet implemented");
549541
}
550542

551-
fn init(&self) {
552-
os::mkdir_recursive(&Path("src"), U_RWX);
553-
os::mkdir_recursive(&Path("lib"), U_RWX);
554-
os::mkdir_recursive(&Path("bin"), U_RWX);
555-
os::mkdir_recursive(&Path("build"), U_RWX);
556-
}
557-
558543
fn uninstall(&self, _id: &str, _vers: Option<~str>) {
559544
fail!("uninstall not yet implemented");
560545
}
@@ -703,7 +688,6 @@ pub fn main_args(args: &[~str]) {
703688
~"list" => usage::list(),
704689
~"prefer" => usage::prefer(),
705690
~"test" => usage::test(),
706-
~"init" => usage::init(),
707691
~"uninstall" => usage::uninstall(),
708692
~"unprefer" => usage::unprefer(),
709693
_ => usage::general()

branches/try2/src/librustpkg/usage.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,3 @@ and exit code will be redirected.
148148
Options:
149149
-c, --cfg Pass a cfg flag to the package script");
150150
}
151-
152-
pub fn init() {
153-
io::println("rustpkg init name
154-
155-
This makes a new workspace for working on a project named name.
156-
");
157-
}

branches/try2/src/librustpkg/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use workcache_support::{digest_file_with_date, digest_only_date};
3333
// you could update the match in rustpkg.rc but forget to update this list. I think
3434
// that should be fixed.
3535
static COMMANDS: &'static [&'static str] =
36-
&["build", "clean", "do", "info", "init", "install", "list", "prefer", "test", "uninstall",
36+
&["build", "clean", "do", "info", "install", "list", "prefer", "test", "uninstall",
3737
"unprefer"];
3838

3939

branches/try2/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/try2/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/try2/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/try2/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)