about summary refs log tree commit diff
path: root/tests/ui/binding/method-call-nonsensical-pattern-binding-7092.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/binding/method-call-nonsensical-pattern-binding-7092.rs')
-rw-r--r--tests/ui/binding/method-call-nonsensical-pattern-binding-7092.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/binding/method-call-nonsensical-pattern-binding-7092.rs b/tests/ui/binding/method-call-nonsensical-pattern-binding-7092.rs
new file mode 100644
index 00000000000..4cb04cdf5be
--- /dev/null
+++ b/tests/ui/binding/method-call-nonsensical-pattern-binding-7092.rs
@@ -0,0 +1,16 @@
+// https://github.com/rust-lang/rust/issues/7092
+enum Whatever {
+}
+
+fn foo(x: Whatever) {
+    match x { //~ NOTE this expression has type `Whatever`
+        Some(field) =>
+//~^ ERROR mismatched types
+//~| NOTE expected `Whatever`, found `Option<_>`
+//~| NOTE expected enum `Whatever`
+//~| NOTE found enum `Option<_>`
+            field.access(),
+    }
+}
+
+fn main(){}