about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorMatthew Jasper <mjjasper1@gmail.com>2018-07-13 23:39:10 +0100
committerMatthew Jasper <mjjasper1@gmail.com>2018-07-21 18:40:46 +0100
commit12412749ab209447611c6d071e187d787c6feeb2 (patch)
tree9a0023a65300dfb124c33251d691a41495c9ee3e /src/test
parent341e5e3a6176737f62c02d9474fefbce31aeb85f (diff)
downloadrust-12412749ab209447611c6d071e187d787c6feeb2.tar.gz
rust-12412749ab209447611c6d071e187d787c6feeb2.zip
Add specific message when moving from upvars in a non-FnOnce closure
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/borrowck/borrowck-in-static.nll.stderr4
-rw-r--r--src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.nll.stderr4
-rw-r--r--src/test/ui/error-codes/E0161.nll.stderr16
-rw-r--r--src/test/ui/issue-4335.nll.stderr4
-rw-r--r--src/test/ui/span/borrowck-call-is-borrow-issue-12224.nll.stderr4
5 files changed, 8 insertions, 24 deletions
diff --git a/src/test/ui/borrowck/borrowck-in-static.nll.stderr b/src/test/ui/borrowck/borrowck-in-static.nll.stderr
index 927d8c37458..05a022a726c 100644
--- a/src/test/ui/borrowck/borrowck-in-static.nll.stderr
+++ b/src/test/ui/borrowck/borrowck-in-static.nll.stderr
@@ -1,8 +1,8 @@
-error[E0507]: cannot move out of borrowed content
+error[E0507]: cannot move out of captured variable in an `Fn` closure
   --> $DIR/borrowck-in-static.rs:15:17
    |
 LL |     Box::new(|| x) //~ ERROR cannot move out of captured outer variable
-   |                 ^ cannot move out of borrowed content
+   |                 ^ cannot move out of captured variable in an `Fn` closure
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.nll.stderr b/src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.nll.stderr
index 7464e33e8c1..07a9f374b2c 100644
--- a/src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.nll.stderr
+++ b/src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.nll.stderr
@@ -1,8 +1,8 @@
-error[E0507]: cannot move out of borrowed content
+error[E0507]: cannot move out of captured variable in an `Fn` closure
   --> $DIR/unboxed-closures-move-upvar-from-non-once-ref-closure.rs:21:9
    |
 LL |         y.into_iter();
-   |         ^ cannot move out of borrowed content
+   |         ^ cannot move out of captured variable in an `Fn` closure
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/error-codes/E0161.nll.stderr b/src/test/ui/error-codes/E0161.nll.stderr
deleted file mode 100644
index 6aaff743383..00000000000
--- a/src/test/ui/error-codes/E0161.nll.stderr
+++ /dev/null
@@ -1,16 +0,0 @@
-error[E0507]: cannot move out of borrowed content
-  --> $DIR/E0161.rs:14:28
-   |
-LL |     let _x: Box<str> = box *"hello"; //~ ERROR E0161
-   |                            ^^^^^^^^ cannot move out of borrowed content
-
-error[E0161]: cannot move a value of type str: the size of str cannot be statically determined
-  --> $DIR/E0161.rs:14:28
-   |
-LL |     let _x: Box<str> = box *"hello"; //~ ERROR E0161
-   |                            ^^^^^^^^
-
-error: aborting due to 2 previous errors
-
-Some errors occurred: E0161, E0507.
-For more information about an error, try `rustc --explain E0161`.
diff --git a/src/test/ui/issue-4335.nll.stderr b/src/test/ui/issue-4335.nll.stderr
index 8eede347478..eacd8b5e580 100644
--- a/src/test/ui/issue-4335.nll.stderr
+++ b/src/test/ui/issue-4335.nll.stderr
@@ -1,8 +1,8 @@
-error[E0507]: cannot move out of borrowed content
+error[E0507]: cannot move out of captured variable in an `FnMut` closure
   --> $DIR/issue-4335.rs:16:20
    |
 LL |     id(Box::new(|| *v))
-   |                    ^^ cannot move out of borrowed content
+   |                    ^^ cannot move out of captured variable in an `FnMut` closure
 
 error[E0597]: `v` does not live long enough
   --> $DIR/issue-4335.rs:16:17
diff --git a/src/test/ui/span/borrowck-call-is-borrow-issue-12224.nll.stderr b/src/test/ui/span/borrowck-call-is-borrow-issue-12224.nll.stderr
index f752015c650..b3563f1b620 100644
--- a/src/test/ui/span/borrowck-call-is-borrow-issue-12224.nll.stderr
+++ b/src/test/ui/span/borrowck-call-is-borrow-issue-12224.nll.stderr
@@ -28,11 +28,11 @@ LL | fn test4(f: &Test) {
 LL |     f.f.call_mut(())
    |     ^^^ `f` is a `&` reference, so the data it refers to cannot be borrowed as mutable
 
-error[E0507]: cannot move out of borrowed content
+error[E0507]: cannot move out of captured variable in an `FnMut` closure
   --> $DIR/borrowck-call-is-borrow-issue-12224.rs:66:13
    |
 LL |         foo(f);
-   |             ^ cannot move out of borrowed content
+   |             ^ cannot move out of captured variable in an `FnMut` closure
 
 error[E0505]: cannot move out of `f` because it is borrowed
   --> $DIR/borrowck-call-is-borrow-issue-12224.rs:65:16