summaryrefslogtreecommitdiffstats
path: root/src/test/ui/suggestions/option-content-move-from-tuple-match.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/suggestions/option-content-move-from-tuple-match.rs')
-rw-r--r--src/test/ui/suggestions/option-content-move-from-tuple-match.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/ui/suggestions/option-content-move-from-tuple-match.rs b/src/test/ui/suggestions/option-content-move-from-tuple-match.rs
new file mode 100644
index 000000000..7f22d8136
--- /dev/null
+++ b/src/test/ui/suggestions/option-content-move-from-tuple-match.rs
@@ -0,0 +1,9 @@
+fn foo(a: &Option<String>, b: &Option<String>) {
+ match (a, b) {
+ //~^ ERROR cannot move out of a shared reference
+ (None, &c) => &c.unwrap(),
+ (&Some(ref c), _) => c,
+ };
+}
+
+fn main() {}