about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/issue-4335.rs4
-rw-r--r--src/test/compile-fail/regions-proc-bound-capture.rs2
-rw-r--r--src/test/compile-fail/regions-steal-closure.rs4
-rwxr-xr-xsrc/test/compile-fail/send-is-not-static-ensures-scoping.rs5
-rw-r--r--src/test/compile-fail/unboxed-closure-region.rs2
5 files changed, 10 insertions, 7 deletions
diff --git a/src/test/compile-fail/issue-4335.rs b/src/test/compile-fail/issue-4335.rs
index d0da51373d9..85298e4c6e0 100644
--- a/src/test/compile-fail/issue-4335.rs
+++ b/src/test/compile-fail/issue-4335.rs
@@ -14,7 +14,9 @@
 fn id<T>(t: T) -> T { t }
 
 fn f<'r, T>(v: &'r T) -> Box<FnMut() -> T + 'r> {
-    id(box || *v) //~ ERROR cannot infer
+    id(box || *v)
+        //~^ ERROR `v` does not live long enough
+        //~| ERROR cannot move out of borrowed content
 }
 
 fn main() {
diff --git a/src/test/compile-fail/regions-proc-bound-capture.rs b/src/test/compile-fail/regions-proc-bound-capture.rs
index 7ea4d1c7507..cc33d112417 100644
--- a/src/test/compile-fail/regions-proc-bound-capture.rs
+++ b/src/test/compile-fail/regions-proc-bound-capture.rs
@@ -18,7 +18,7 @@ fn borrowed_proc<'a>(x: &'a isize) -> Box<FnMut()->(isize) + 'a> {
 
 fn static_proc(x: &isize) -> Box<FnMut()->(isize) + 'static> {
     // This is illegal, because the region bound on `proc` is 'static.
-    box move|| { *x } //~ ERROR cannot infer
+    box move|| { *x } //~ ERROR captured variable `x` does not outlive the enclosing closure
 }
 
 fn main() { }
diff --git a/src/test/compile-fail/regions-steal-closure.rs b/src/test/compile-fail/regions-steal-closure.rs
index 97b51fdb325..c9b378d1df2 100644
--- a/src/test/compile-fail/regions-steal-closure.rs
+++ b/src/test/compile-fail/regions-steal-closure.rs
@@ -20,9 +20,9 @@ fn box_it<'r>(x: Box<FnMut() + 'r>) -> closure_box<'r> {
 }
 
 fn main() {
-    let cl_box = {
+    let mut cl_box = {
         let mut i = 3;
-        box_it(box || i += 1) //~ ERROR cannot infer
+        box_it(box || i += 1) //~ ERROR `i` does not live long enough
     };
     cl_box.cl.call_mut(());
 }
diff --git a/src/test/compile-fail/send-is-not-static-ensures-scoping.rs b/src/test/compile-fail/send-is-not-static-ensures-scoping.rs
index abbcd7e4590..fe03ca8353d 100755
--- a/src/test/compile-fail/send-is-not-static-ensures-scoping.rs
+++ b/src/test/compile-fail/send-is-not-static-ensures-scoping.rs
@@ -13,9 +13,10 @@ use std::thread;
 fn main() {
     let bad = {
         let x = 1;
-        let y = &x;
+        let y = &x; //~ ERROR `x` does not live long enough
 
-        thread::scoped(|| { //~ ERROR cannot infer an appropriate lifetime
+        thread::scoped(|| {
+            //~^ ERROR `y` does not live long enough
             let _z = y;
         })
     };
diff --git a/src/test/compile-fail/unboxed-closure-region.rs b/src/test/compile-fail/unboxed-closure-region.rs
index 59c84953718..5f4bf0d33be 100644
--- a/src/test/compile-fail/unboxed-closure-region.rs
+++ b/src/test/compile-fail/unboxed-closure-region.rs
@@ -15,6 +15,6 @@
 fn main() {
     let _f = {
         let x = 0_usize;
-        || x //~ ERROR cannot infer an appropriate lifetime due to conflicting requirements
+        || x //~ ERROR `x` does not live long enough
     };
 }