summaryrefslogtreecommitdiffstats
path: root/tests/ui/rfcs/rfc-2294-if-let-guard/type-inference.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/rfcs/rfc-2294-if-let-guard/type-inference.rs')
-rw-r--r--tests/ui/rfcs/rfc-2294-if-let-guard/type-inference.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/rfcs/rfc-2294-if-let-guard/type-inference.rs b/tests/ui/rfcs/rfc-2294-if-let-guard/type-inference.rs
new file mode 100644
index 000000000..ef7a772e6
--- /dev/null
+++ b/tests/ui/rfcs/rfc-2294-if-let-guard/type-inference.rs
@@ -0,0 +1,16 @@
+// check-pass
+
+#![feature(if_let_guard)]
+
+struct S;
+
+fn get<T>() -> Option<T> {
+ None
+}
+
+fn main() {
+ match get() {
+ x if let Some(S) = x => {}
+ _ => {}
+ }
+}