diff options
Diffstat (limited to 'tests/ui/liveness/liveness-move-call-arg-2.rs')
-rw-r--r-- | tests/ui/liveness/liveness-move-call-arg-2.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/liveness/liveness-move-call-arg-2.rs b/tests/ui/liveness/liveness-move-call-arg-2.rs new file mode 100644 index 000000000..b93535c89 --- /dev/null +++ b/tests/ui/liveness/liveness-move-call-arg-2.rs @@ -0,0 +1,12 @@ +fn take(_x: Box<isize>) {} + + +fn main() { + let _ = || { + let x: Box<isize> = Box::new(25); + + loop { + take(x); //~ ERROR use of moved value: `x` + } + }; +} |