about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorMatthew Jasper <mjjasper1@gmail.com>2019-11-08 22:54:00 +0000
committerMatthew Jasper <mjjasper1@gmail.com>2019-11-27 19:47:12 +0000
commit1d53e437442b44b5c530c45cf9fdfd595ad715b1 (patch)
treefe757f70195a60672a38f29bf4b2631eaedce14a /src/test
parenta5b8a3088a61a564fb2e4de97d4d26e321eb66bd (diff)
downloadrust-1d53e437442b44b5c530c45cf9fdfd595ad715b1.tar.gz
rust-1d53e437442b44b5c530c45cf9fdfd595ad715b1.zip
Simplify `mem_categorization`
* `Place` is no longer recursive.
* The `cmt` type alias is removed
* `Upvar` places no longer include the dereferences of the environment
  closure or of by reference captures.
* All non-dereference projections are combined to a single variant.
* Various unnecessary types and methods have been removed.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/issues/issue-4335.rs3
-rw-r--r--src/test/ui/issues/issue-4335.stderr23
-rw-r--r--src/test/ui/regions/regions-addr-of-upvar-self.stderr2
-rw-r--r--src/test/ui/unboxed-closures/unboxed-closures-infer-fn-once-move-from-projection.stderr2
4 files changed, 5 insertions, 25 deletions
diff --git a/src/test/ui/issues/issue-4335.rs b/src/test/ui/issues/issue-4335.rs
index a10ae9a1243..c5914a17cf9 100644
--- a/src/test/ui/issues/issue-4335.rs
+++ b/src/test/ui/issues/issue-4335.rs
@@ -4,8 +4,7 @@ fn id<T>(t: T) -> T { t }
 
 fn f<'r, T>(v: &'r T) -> Box<dyn FnMut() -> T + 'r> {
     id(Box::new(|| *v))
-        //~^ ERROR E0373
-        //~| ERROR E0507
+        //~^ ERROR E0507
 }
 
 fn main() {
diff --git a/src/test/ui/issues/issue-4335.stderr b/src/test/ui/issues/issue-4335.stderr
index ca1c0b68d2a..f187969ff4e 100644
--- a/src/test/ui/issues/issue-4335.stderr
+++ b/src/test/ui/issues/issue-4335.stderr
@@ -6,25 +6,6 @@ LL | fn f<'r, T>(v: &'r T) -> Box<dyn FnMut() -> T + 'r> {
 LL |     id(Box::new(|| *v))
    |                    ^^ move occurs because `*v` has type `T`, which does not implement the `Copy` trait
 
-error[E0373]: closure may outlive the current function, but it borrows `v`, which is owned by the current function
-  --> $DIR/issue-4335.rs:6:17
-   |
-LL |     id(Box::new(|| *v))
-   |                 ^^  - `v` is borrowed here
-   |                 |
-   |                 may outlive borrowed value `v`
-   |
-note: closure is returned here
-  --> $DIR/issue-4335.rs:6:5
-   |
-LL |     id(Box::new(|| *v))
-   |     ^^^^^^^^^^^^^^^^^^^
-help: to force the closure to take ownership of `v` (and any other referenced variables), use the `move` keyword
-   |
-LL |     id(Box::new(move || *v))
-   |                 ^^^^^^^
-
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
-Some errors have detailed explanations: E0373, E0507.
-For more information about an error, try `rustc --explain E0373`.
+For more information about this error, try `rustc --explain E0507`.
diff --git a/src/test/ui/regions/regions-addr-of-upvar-self.stderr b/src/test/ui/regions/regions-addr-of-upvar-self.stderr
index 7a051b8ac83..005800d50a4 100644
--- a/src/test/ui/regions/regions-addr-of-upvar-self.stderr
+++ b/src/test/ui/regions/regions-addr-of-upvar-self.stderr
@@ -9,7 +9,7 @@ note: first, the lifetime cannot outlive the lifetime `'_` as defined on the bod
    |
 LL |         let _f = || {
    |                  ^^
-note: ...so that reference does not outlive borrowed content
+note: ...so that closure can access `self`
   --> $DIR/regions-addr-of-upvar-self.rs:10:41
    |
 LL |             let p: &'static mut usize = &mut self.food;
diff --git a/src/test/ui/unboxed-closures/unboxed-closures-infer-fn-once-move-from-projection.stderr b/src/test/ui/unboxed-closures/unboxed-closures-infer-fn-once-move-from-projection.stderr
index 9287353245e..68ec8d2ba82 100644
--- a/src/test/ui/unboxed-closures/unboxed-closures-infer-fn-once-move-from-projection.stderr
+++ b/src/test/ui/unboxed-closures/unboxed-closures-infer-fn-once-move-from-projection.stderr
@@ -2,7 +2,7 @@ error[E0525]: expected a closure that implements the `Fn` trait, but this closur
   --> $DIR/unboxed-closures-infer-fn-once-move-from-projection.rs:14:13
    |
 LL |     let c = || drop(y.0);
-   |             ^^^^^^^^-^^^
+   |             ^^^^^^^^---^
    |             |       |
    |             |       closure is `FnOnce` because it moves the variable `y` out of its environment
    |             this closure implements `FnOnce`, not `Fn`