diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/moves/move-out-of-tuple-field.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/ui/moves/move-out-of-tuple-field.rs b/src/test/ui/moves/move-out-of-tuple-field.rs new file mode 100644 index 000000000..66912fa4d --- /dev/null +++ b/src/test/ui/moves/move-out-of-tuple-field.rs @@ -0,0 +1,13 @@ +struct Foo(Box<isize>); + + + +fn main() { + let x: (Box<_>,) = (Box::new(1),); + let y = x.0; + let z = x.0; //~ ERROR use of moved value: `x.0` + + let x = Foo(Box::new(1)); + let y = x.0; + let z = x.0; //~ ERROR use of moved value: `x.0` +} |