summaryrefslogtreecommitdiffstats
path: root/src/test/ui/moves/issue-99470-move-out-of-some.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/moves/issue-99470-move-out-of-some.rs')
-rw-r--r--src/test/ui/moves/issue-99470-move-out-of-some.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/ui/moves/issue-99470-move-out-of-some.rs b/src/test/ui/moves/issue-99470-move-out-of-some.rs
new file mode 100644
index 000000000..f404cd3cd
--- /dev/null
+++ b/src/test/ui/moves/issue-99470-move-out-of-some.rs
@@ -0,0 +1,9 @@
+fn main() {
+ let x: &Option<Box<i32>> = &Some(Box::new(0));
+
+ match x {
+ //~^ ERROR cannot move out of `x` as enum variant `Some` which is behind a shared reference
+ &Some(_y) => (),
+ &None => (),
+ }
+}