summaryrefslogtreecommitdiffstats
path: root/tests/ui/rfc-2294-if-let-guard/bindings.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/rfc-2294-if-let-guard/bindings.rs')
-rw-r--r--tests/ui/rfc-2294-if-let-guard/bindings.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/rfc-2294-if-let-guard/bindings.rs b/tests/ui/rfc-2294-if-let-guard/bindings.rs
new file mode 100644
index 000000000..1f32e4af1
--- /dev/null
+++ b/tests/ui/rfc-2294-if-let-guard/bindings.rs
@@ -0,0 +1,9 @@
+#![feature(if_let_guard)]
+
+fn main() {
+ match Some(None) {
+ Some(x) if let Some(y) = x => (x, y),
+ _ => y, //~ ERROR cannot find value `y`
+ }
+ y //~ ERROR cannot find value `y`
+}