diff options
Diffstat (limited to 'src/test/ui/rfc-2294-if-let-guard')
-rw-r--r-- | src/test/ui/rfc-2294-if-let-guard/feature-gate.stderr | 6 | ||||
-rw-r--r-- | src/test/ui/rfc-2294-if-let-guard/run-pass.rs | 7 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/test/ui/rfc-2294-if-let-guard/feature-gate.stderr b/src/test/ui/rfc-2294-if-let-guard/feature-gate.stderr index e017d04a5..96fe11911 100644 --- a/src/test/ui/rfc-2294-if-let-guard/feature-gate.stderr +++ b/src/test/ui/rfc-2294-if-let-guard/feature-gate.stderr @@ -72,6 +72,12 @@ LL | macro_rules! use_expr { ... LL | use_expr!(let 0 = 1); | ^^^ no rules expected this token in macro call + | +note: while trying to match meta-variable `$e:expr` + --> $DIR/feature-gate.rs:61:10 + | +LL | ($e:expr) => { + | ^^^^^^^ error[E0658]: `if let` guards are experimental --> $DIR/feature-gate.rs:7:12 diff --git a/src/test/ui/rfc-2294-if-let-guard/run-pass.rs b/src/test/ui/rfc-2294-if-let-guard/run-pass.rs index 3da57989d..a303a0d1f 100644 --- a/src/test/ui/rfc-2294-if-let-guard/run-pass.rs +++ b/src/test/ui/rfc-2294-if-let-guard/run-pass.rs @@ -30,4 +30,11 @@ fn main() { Some(x) if let Foo::Qux(y) = qux(x) => assert_eq!(y, 84), _ => panic!(), } + + // issue #88015 + #[allow(irrefutable_let_patterns)] + match () { + () | () if let x = 42 => assert_eq!(x, 42), + _ => panic!() + } } |