From a0206f53d21e2ab9ff43fb65b5cf16a7ece97f08 Mon Sep 17 00:00:00 2001 From: topecongiro Date: Sun, 1 Jul 2018 10:40:47 +0900 Subject: [PATCH] Add a test for #2782 --- tests/source/expr.rs | 5 +++++ tests/target/expr.rs | 31 +++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/tests/source/expr.rs b/tests/source/expr.rs index 3d9e54e08f0..0c4799af3d2 100644 --- a/tests/source/expr.rs +++ b/tests/source/expr.rs @@ -435,3 +435,8 @@ fn issue2704() { .filter(|_| true) .collect()); } + +// #2782 +fn issue2782() { + {let f={let f={{match f{F(f,_)=>{{loop{let f={match f{F(f,_)=>{{match f{F(f,_)=>{{loop{let f={let f={match f{'-'=>F(f,()),}};};}}}}}}}};}}}}}};};} +} diff --git a/tests/target/expr.rs b/tests/target/expr.rs index 94640b71c5f..9a529ffeaee 100644 --- a/tests/target/expr.rs +++ b/tests/target/expr.rs @@ -476,3 +476,34 @@ fn issue2704() { .collect(), ); } + +// #2782 +fn issue2782() { + { + let f = { + let f = { + { + match f { + F(f, _) => loop { + let f = { + match f { + F(f, _) => match f { + F(f, _) => loop { + let f = { + let f = { + match f { + '-' => F(f, ()), + } + }; + }; + }, + }, + } + }; + }, + } + } + }; + }; + } +}