diff options
Diffstat (limited to 'src/test/ui/closures/issue-6801.rs')
-rw-r--r-- | src/test/ui/closures/issue-6801.rs | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/src/test/ui/closures/issue-6801.rs b/src/test/ui/closures/issue-6801.rs deleted file mode 100644 index cecb08f00..000000000 --- a/src/test/ui/closures/issue-6801.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Creating a stack closure which references a box and then -// transferring ownership of the box before invoking the stack -// closure results in a crash. - - - -fn twice(x: Box<usize>) -> usize { - *x * 2 -} - -fn invoke<F>(f: F) where F: FnOnce() -> usize { - f(); -} - -fn main() { - let x : Box<usize> = Box::new(9); - let sq = || { *x * *x }; - - twice(x); //~ ERROR: cannot move out of - invoke(sq); -} |