summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorAriel Ben-Yehuda <ariel.byd@gmail.com>2017-04-13 21:27:35 +0300
committerAriel Ben-Yehuda <ariel.byd@gmail.com>2017-04-13 21:27:35 +0300
commit03b0d995564b26a2ca9ccf0ded8a6fd375dd9412 (patch)
treead8a51481ca98745321b8e0fa2b9dd6c199b340f /src/test
parentc58c928e658d2e45f816fd05796a964aa83759da (diff)
downloadrust-03b0d995564b26a2ca9ccf0ded8a6fd375dd9412.tar.gz
rust-03b0d995564b26a2ca9ccf0ded8a6fd375dd9412.zip
rustc_typeck: consolidate adjustment composition
Fixes #41213.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass/issue-41213.rs32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/test/run-pass/issue-41213.rs b/src/test/run-pass/issue-41213.rs
new file mode 100644
index 00000000000..d4755020fef
--- /dev/null
+++ b/src/test/run-pass/issue-41213.rs
@@ -0,0 +1,32 @@
+// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+enum A {
+    A1,
+    A2,
+    A3,
+}
+
+enum B {
+    B1(String, String),
+    B2(String, String),
+}
+
+fn main() {
+    let a = A::A1;
+    loop {
+        let _ctor = match a {
+            A::A3 => break,
+            A::A1 => B::B1,
+            A::A2 => B::B2,
+        };
+        break;
+    }
+}