summaryrefslogtreecommitdiffstats
path: root/src/test/ui/pattern/move-ref-patterns/issue-53840.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/pattern/move-ref-patterns/issue-53840.rs')
-rw-r--r--src/test/ui/pattern/move-ref-patterns/issue-53840.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/ui/pattern/move-ref-patterns/issue-53840.rs b/src/test/ui/pattern/move-ref-patterns/issue-53840.rs
new file mode 100644
index 000000000..80effc497
--- /dev/null
+++ b/src/test/ui/pattern/move-ref-patterns/issue-53840.rs
@@ -0,0 +1,20 @@
+// check-pass
+
+enum E {
+ Foo(String, String, String),
+}
+
+struct Bar {
+ a: String,
+ b: String,
+}
+
+fn main() {
+ let bar = Bar { a: "1".to_string(), b: "2".to_string() };
+ match E::Foo("".into(), "".into(), "".into()) {
+ E::Foo(a, b, ref c) => {}
+ }
+ match bar {
+ Bar { a, ref b } => {}
+ }
+}