diff options
| author | David Wood <david@davidtw.co> | 2018-10-04 21:48:50 +0200 |
|---|---|---|
| committer | David Wood <david@davidtw.co> | 2018-10-09 12:31:51 +0200 |
| commit | 98633b458b6dbde4afd1b468f35a1b8239b5c15c (patch) | |
| tree | 951099c1983cda64fd99ab43055780a852b493bb /src/test/ui/regions | |
| parent | c65e11922908189bb13d67a490d49163c110b510 (diff) | |
| download | rust-98633b458b6dbde4afd1b468f35a1b8239b5c15c.tar.gz rust-98633b458b6dbde4afd1b468f35a1b8239b5c15c.zip | |
Improve message for closure returning a closure.
Now when a `FnMut` closure is returning a closure that contains a reference to a captured variable, we provide an error that makes it more clear what is happening.
Diffstat (limited to 'src/test/ui/regions')
| -rw-r--r-- | src/test/ui/regions/regions-return-ref-to-upvar-issue-17403.nll.stderr | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/ui/regions/regions-return-ref-to-upvar-issue-17403.nll.stderr b/src/test/ui/regions/regions-return-ref-to-upvar-issue-17403.nll.stderr index 8ce249f2a29..300a5639822 100644 --- a/src/test/ui/regions/regions-return-ref-to-upvar-issue-17403.nll.stderr +++ b/src/test/ui/regions/regions-return-ref-to-upvar-issue-17403.nll.stderr @@ -2,7 +2,7 @@ error: captured variable cannot escape `FnMut` closure body --> $DIR/regions-return-ref-to-upvar-issue-17403.rs:17:24 | LL | let mut f = || &mut x; //~ ERROR cannot infer - | - ^^^^^^ creates a reference to a captured variable which escapes the closure body + | - ^^^^^^ returns a reference to a captured variable which escapes the closure body | | | inferred to be a `FnMut` closure | |
