summaryrefslogtreecommitdiffstats
path: root/src/test/ui/mir/issue-89485.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/mir/issue-89485.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/ui/mir/issue-89485.rs b/src/test/ui/mir/issue-89485.rs
new file mode 100644
index 000000000..cb507eefe
--- /dev/null
+++ b/src/test/ui/mir/issue-89485.rs
@@ -0,0 +1,18 @@
+// Regression test for issue #89485.
+
+// run-pass
+
+#[derive(Debug, Eq, PartialEq)]
+pub enum Type {
+ A = 1,
+ B = 2,
+}
+pub fn encode(v: Type) -> Type {
+ match v {
+ Type::A => Type::B,
+ _ => v,
+ }
+}
+fn main() {
+ assert_eq!(Type::B, encode(Type::A));
+}