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, ()), + } + }; + }; + }, + }, + } + }; + }, + } + } + }; + }; + } +}