]> git.lizzy.rs Git - rust.git/commitdiff
librustc: Fix merge fallout.
authorPatrick Walton <pcwalton@mimiga.net>
Sun, 24 Nov 2013 19:44:28 +0000 (11:44 -0800)
committerPatrick Walton <pcwalton@mimiga.net>
Tue, 26 Nov 2013 19:04:39 +0000 (11:04 -0800)
24 files changed:
src/libextra/json.rs
src/libextra/sync.rs
src/libextra/time.rs
src/librustc/middle/lint.rs
src/librustc/middle/privacy.rs
src/librustpkg/testsuite/pass/src/c-dependencies/pkg.rs
src/librustuv/net.rs
src/libstd/rc.rs
src/libstd/rt/args.rs
src/libstd/rt/comm.rs
src/libstd/select.rs
src/libstd/unstable/sync.rs
src/libstd/vec.rs
src/test/bench/core-set.rs
src/test/bench/shootout-pfib.rs
src/test/bench/task-perf-spawnalot.rs
src/test/debug-info/lexical-scope-in-unique-closure.rs
src/test/debug-info/var-captured-in-sendable-closure.rs
src/test/pretty/disamb-stmt-expr.rs
src/test/pretty/do1.rs
src/test/run-pass/borrowck-preserve-box-in-field.rs
src/test/run-pass/borrowck-preserve-box-in-uniq.rs
src/test/run-pass/borrowck-preserve-box.rs
src/test/run-pass/borrowck-preserve-expl-deref.rs

index c30963568286ff18005ba26dff2dea926ef6a8ed..8dcf0a919d37fc87d780a7b881de8d3a7e895810 100644 (file)
@@ -1983,7 +1983,7 @@ enum DecodeEnum {
     }
     fn check_err<T: Decodable<Decoder>>(to_parse: &'static str, expected_error: &str) {
         use std::task;
-        let res = task::try(|| {
+        let res = do task::try {
             // either fails in `decode` (which is what we want), or
             // returns Some(error_message)/None if the string was
             // invalid or valid JSON.
@@ -1994,7 +1994,7 @@ fn check_err<T: Decodable<Decoder>>(to_parse: &'static str, expected_error: &str
                     None
                 }
             }
-        });
+        };
         match res {
             Ok(Some(parse_error)) => fail!("`{}` is not valid json: {}",
                                            to_parse, parse_error),
index 0d5368695b79cfc962a2cbb8261b1581a6128fc8..6167a4293806f8c8fa3ec94c8162fd47d61386e8 100644 (file)
@@ -230,12 +230,8 @@ pub fn wait_on(&self, condvar_id: uint) {
             }).finally(|| {
                 // Reacquire the condvar.
                 match self.order {
-                    Just(lock) => do lock.access {
-                        self.sem.acquire();
-                    },
-                    Nothing => {
-                        self.sem.acquire();
-                    },
+                    Just(lock) => lock.access(|| self.sem.acquire()),
+                    Nothing => self.sem.acquire(),
                 }
             })
         })
index fb80ce026257d6e35f8ec13302ce8943befefc7f..1352bfd424f680e3c79277c947324e6bbbc28cb9 100644 (file)
@@ -969,9 +969,9 @@ fn set_time_zone() {
             // Windows does not understand "America/Los_Angeles".
             // PST+08 may look wrong, but not! "PST" indicates
             // the name of timezone. "+08" means UTC = local + 08.
-            do "TZ=PST+08".with_c_str |env| {
+            "TZ=PST+08".with_c_str(|env| {
                 _putenv(env);
-            }
+            })
         }
         tzset();
     }
index 29e28204bd98f10aedb61e16e0a0244cf5c2e229..38b7bc0875bfc82653abd4c35c752fd6540fee37 100644 (file)
@@ -1204,17 +1204,17 @@ fn visit_item(&mut self, it: @ast::item, _: ()) {
     }
 
     fn visit_foreign_item(&mut self, it: @ast::foreign_item, _: ()) {
-        do self.with_lint_attrs(it.attrs) |cx| {
+        self.with_lint_attrs(it.attrs, |cx| {
             check_attrs_usage(cx, it.attrs);
             visit::walk_foreign_item(cx, it, ());
-        }
+        })
     }
 
     fn visit_view_item(&mut self, i: &ast::view_item, _: ()) {
-        do self.with_lint_attrs(i.attrs) |cx| {
+        self.with_lint_attrs(i.attrs, |cx| {
             check_attrs_usage(cx, i.attrs);
             visit::walk_view_item(cx, i, ());
-        }
+        })
     }
 
     fn visit_pat(&mut self, p: &ast::Pat, _: ()) {
index 90bbbaeaf6f748d7620c34fa498cb3b63ed9d48f..c2a21905be6d54c0a82c0fea2e6f9c93b040ac3b 100644 (file)
@@ -232,10 +232,10 @@ fn visit_item(&mut self, item: @ast::item, _: ()) {
                     _ => true,
                 };
                 let tr = ty::impl_trait_ref(self.tcx, local_def(item.id));
-                let public_trait = do tr.map_default(false) |tr| {
+                let public_trait = tr.map_default(false, |tr| {
                     !is_local(tr.def_id) ||
                      self.exported_items.contains(&tr.def_id.node)
-                };
+                });
 
                 if public_ty || public_trait {
                     for method in methods.iter() {
index 180f8cc74cee68c9d900a93e7361e666c3cee13e..122f80a52f1cad06af724b56b178e709859d7853 100644 (file)
@@ -50,7 +50,7 @@ pub fn main() {
         prep.declare_input("file",
                            foo_c_name.as_str().unwrap().to_owned(),
                            digest_file_with_date(&foo_c_name));
-        let out_path = prep.exec(|exec| {
+        let out_path = do prep.exec |exec| {
             let out_path = api::build_library_in_workspace(exec,
                                                            &mut sub_cx.clone(),
                                                            "cdep",
@@ -60,7 +60,7 @@ pub fn main() {
                                                            "foo");
             let out_p = Path::new(out_path);
             out_p.as_str().unwrap().to_owned()
-        });
+        };
         out_path
     });
     let out_lib_path = Path::new(out_lib_path);
index 8372127c6714649da768296e80019aba503f17db..7fb665b858fd77f6d1b435a90b4569941a871e73 100644 (file)
@@ -186,9 +186,9 @@ struct Ctx { status: c_int, task: Option<BlockedTask> }
                 0 => {
                     req.defuse(); // uv callback now owns this request
                     let mut cx = Ctx { status: 0, task: None };
-                    do wait_until_woken_after(&mut cx.task) {
+                    wait_until_woken_after(&mut cx.task, || {
                         req.set_data(&cx);
-                    }
+                    });
                     match cx.status {
                         0 => Ok(()),
                         n => Err(UvError(n)),
index 9506a772ee811107f80882942507d73f3af7c3ad..f2beea992c67a13d430c90ec41eaf3668ce00c26 100644 (file)
@@ -168,28 +168,6 @@ fn drop(&mut self) {
     }
 }
 
-impl<T> Clone for RcMut<T> {
-    /// Return a shallow copy of the reference counted pointer.
-    #[inline]
-    fn clone(&self) -> RcMut<T> {
-        unsafe {
-            (*self.ptr).count += 1;
-            RcMut{ptr: self.ptr}
-        }
-    }
-}
-
-impl<T: DeepClone> DeepClone for RcMut<T> {
-    /// Return a deep copy of the reference counted pointer.
-    #[inline]
-    fn deep_clone(&self) -> RcMut<T> {
-        self.with_borrow(|x| {
-            // FIXME: #6497: should avoid freeze (slow)
-            unsafe { RcMut::new_unchecked(x.deep_clone()) }
-        })
-    }
-}
-
 #[cfg(test)]
 mod test_rc {
     use super::*;
index 82b98fa7f9a09f5501a9e2e452e9c18a69d00cc3..43e8096a8b113a6aa34640e3591865178fc39f9f 100644 (file)
@@ -150,14 +150,14 @@ fn smoke_test() {
             assert!(take() == Some(expected.clone()));
             assert!(take() == None);
 
-            do (|| {
-            }).finally {
+            (|| {
+            }).finally(|| {
                 // Restore the actual global state.
                 match saved_value {
                     Some(ref args) => put(args.clone()),
                     None => ()
                 }
-            }
+            })
         }
     }
 }
index 52a6d67cb05fb01ed499f6961d17ab3e428d9397..06743bce9bf49a3293ac5ac46876a9cf910dcb31 100644 (file)
@@ -990,11 +990,11 @@ fn recv(port: Port<~int>, i: int) {
     #[test]
     fn recv_a_lot() {
         // Regression test that we don't run out of stack in scheduler context
-        run_in_newsched_task(|| {
+        do run_in_newsched_task {
             let (port, chan) = stream();
             10000.times(|| { chan.send(()) });
             10000.times(|| { port.recv() });
-        })
+        }
     }
 
     #[test]
index 9b83c493065d2fcfb98f4e870246f6f790923e5d..43f1c3c529671281f0c8bba088589365d024b935 100644 (file)
@@ -76,7 +76,7 @@ pub fn select<A: Select>(ports: &mut [A]) -> uint {
 
             let c = Cell::new(c.take());
             do sched.event_loop.callback { c.take().send_deferred(()) }
-        }
+        })
     }).finally(|| {
         // Unkillable is necessary not because getting killed is dangerous here,
         // but to force the recv not to use the same kill-flag that we used for
index 1f243d08243dbbbb2e94a06405aa5496f6521980..03745c2c3485bdf00bda9d100e1109dcb4542d42 100644 (file)
@@ -135,7 +135,7 @@ pub fn get_immut(&self) -> *T {
     /// block; otherwise, an unwrapping task can be killed by linked failure.
     pub fn unwrap(self) -> T {
         unsafe {
-            let mut this = this;
+            let mut this = self;
             // The ~ dtor needs to run if this code succeeds.
             let mut data: ~ArcData<T> = cast::transmute(this.data);
             // Set up the unwrap protocol.
@@ -192,7 +192,7 @@ pub fn unwrap(self) -> T {
                 cast::forget(data);
                 fail!("Another task is already unwrapping this Arc!");
             }
-        })
+        }
     }
 
     /// As unwrap above, but without blocking. Returns 'UnsafeArcSelf(self)' if this is
index 22cf57979a1a21780d1a99d57582d65a2913b554..1d562d648499c4e66da2adde15bdadcf1e2dc174 100644 (file)
@@ -863,11 +863,11 @@ pub trait ImmutableVector<'self, T> {
     /// Returns an iterator over the subslices of the vector which are
     /// separated by elements that match `pred`, limited to splitting
     /// at most `n` times.
-    fn splitn(self, n: uint, pred: |&T| -> bool) -> SplitIterator<'self, T>;
+    fn splitn(self, n: uint, pred: 'self |&T| -> bool) -> SplitIterator<'self, T>;
     /// Returns an iterator over the subslices of the vector which are
     /// separated by elements that match `pred`. This starts at the
     /// end of the vector and works backwards.
-    fn rsplit(self, pred: |&T| -> bool) -> RSplitIterator<'self, T>;
+    fn rsplit(self, pred: 'self |&T| -> bool) -> RSplitIterator<'self, T>;
     /// Returns an iterator over the subslices of the vector which are
     /// separated by elements that match `pred` limited to splitting
     /// at most `n` times. This starts at the end of the vector and
index ff3ab37b29cb906c1eb4a32e0e32095e94b7a585..57205ca2c583df7324fd77bc11cd7eff169f546c 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-pretty
+
 // Copyright 2013 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index 07e1b149932a06755c98e436db5eb76c879f5540..da25f1e82eebb77c310afd6221cec7b7f8a2ee3e 100644 (file)
@@ -37,9 +37,9 @@ fn pfib(c: &SharedChan<int>, n: int) {
             let (pp, cc) = stream();
             let cc = SharedChan::new(cc);
             let ch = cc.clone();
-            task::spawn(|| pfib(&ch, n - 1) );
+            task::spawn(proc() pfib(&ch, n - 1));
             let ch = cc.clone();
-            task::spawn(|| pfib(&ch, n - 2) );
+            task::spawn(proc() pfib(&ch, n - 2));
             c.send(pp.recv() + pp.recv());
         }
     }
index ef749960eb924acdcc71cec09817ba871b5bc0eb..e322aceb5e6619d6163f650da1be5af334f7370c 100644 (file)
@@ -15,7 +15,7 @@
 fn f(n: uint) {
     let mut i = 0u;
     while i < n {
-        task::try(|| g() );
+        task::try(proc() g());
         i += 1u;
     }
 }
index da9220322dd74f2776c96fb594782acd1c2a781e..2c732f9f8501f96606bba8c679b4f67f5aeb6d7c 100644 (file)
@@ -51,7 +51,7 @@ fn main() {
     zzz();
     sentinel();
 
-    let unique_closure: proc(int) = |x| {
+    let unique_closure: proc(int) = proc(x) {
         zzz();
         sentinel();
 
index 664e377c9fbe99e4692c147f84ae53c7dfc80299..82618aa1f137c7bf23637793b751c7b793e40099 100644 (file)
@@ -39,7 +39,7 @@ fn main() {
 
     let owned = ~5;
 
-    let closure: proc() = || {
+    let closure: proc() = proc() {
         zzz();
         do_something(&constant, &a_struct.a, owned);
     };
index d3d6f1c0e355b09f1b3309961422bdd68b77f031..78658a4c12169db5709fcdefc9dd14c3c5ed4f97 100644 (file)
@@ -16,5 +16,5 @@
 
 fn id(f: || -> int) -> int { f() }
 
-fn wsucc(_n: int) -> int { (do id || { 1 }) - 0 }
+fn wsucc(_n: int) -> int { id(|| { 1 }) - 0 }
 fn main() { }
index 1fb2359da53acc16a8a4a84f9cde49de9d85ac19..cd7a5b29a8af1eef189c8604220e33efad5a995e 100644 (file)
@@ -12,4 +12,4 @@
 
 fn f(f: |int|) { f(10) }
 
-fn main() { do f |i| { assert!(i == 10) } }
+fn main() { f(|i| { assert!(i == 10) }) }
index 506d777013cd25bb57dee4d95bd706b689a886c2..1caf5c033763f510d7a155641e10ba551c668556 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-pretty
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index d7f7a8e47a2309619cb5176d3336da19c2372150..2b8180be00e2edd1466a387e3e7442b6aad73eab 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-pretty
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index feea06cd69a189733608aab1980878b683c73876..2acaf54f05f437584a216752a459e0b861d69a1c 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-pretty
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.
index d131a529f1a360124a8c55f547c6f55de00328f9..4400b03e31324ccc4ac7eae96435cefbbd81c025 100644 (file)
@@ -1,3 +1,5 @@
+// xfail-pretty
+
 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
 // file at the top-level directory of this distribution and at
 // http://rust-lang.org/COPYRIGHT.