summaryrefslogtreecommitdiffstats
path: root/src/test/ui/rfc-2294-if-let-guard/typeck.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/rfc-2294-if-let-guard/typeck.rs')
-rw-r--r--src/test/ui/rfc-2294-if-let-guard/typeck.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/ui/rfc-2294-if-let-guard/typeck.rs b/src/test/ui/rfc-2294-if-let-guard/typeck.rs
new file mode 100644
index 000000000..ad178dfa4
--- /dev/null
+++ b/src/test/ui/rfc-2294-if-let-guard/typeck.rs
@@ -0,0 +1,15 @@
+#![feature(if_let_guard)]
+
+fn ok() -> Result<Option<bool>, ()> {
+ Ok(Some(true))
+}
+
+fn main() {
+ match ok() {
+ Ok(x) if let Err(_) = x => {},
+ //~^ ERROR mismatched types
+ Ok(x) if let 0 = x => {},
+ //~^ ERROR mismatched types
+ _ => {}
+ }
+}