forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#41523 - estebank:moved, r=arielb1
Point at variable moved by closure Fix rust-lang#41482, rust-lang#31752.
- Loading branch information
Showing
7 changed files
with
63 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
error[E0507]: cannot move out of captured outer variable in an `Fn` closure | ||
--> $DIR/borrowck-in-static.rs:15:17 | ||
| | ||
14 | let x = Box::new(0); //~ NOTE moved | ||
| - captured outer variable | ||
15 | Box::new(|| x) //~ ERROR cannot move out of captured outer variable | ||
| ^ cannot move out of captured outer variable in an `Fn` closure | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/test/ui/borrowck/unboxed-closures-move-upvar-from-non-once-ref-closure.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
error[E0507]: cannot move out of captured outer variable in an `Fn` closure | ||
--> $DIR/unboxed-closures-move-upvar-from-non-once-ref-closure.rs:21:9 | ||
| | ||
19 | let y = vec![format!("World")]; //~ NOTE moved | ||
| - captured outer variable | ||
20 | call(|| { | ||
21 | y.into_iter(); | ||
| ^ cannot move out of captured outer variable in an `Fn` closure | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters