rust/tests/target/issue-3029.rs
Otavio Salvador ef59b34cd7 Avoid control flow expressions conditions to go multi line
Extends the multi line condition to over other control flow
expressions, it now covers: `if`, `if let`, `for`, `loop`, `while`,
`while let` and `match`.

Refs: #3029

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2018-10-13 14:12:43 -03:00

95 lines
2.0 KiB
Rust

fn keep_if() {
{
{
{
EvaluateJSReply::NumberValue(
if FromJSValConvertible::from_jsval(cx, rval.handle(), ()) {
unimplemented!();
},
)
}
}
}
}
fn keep_if_let() {
{
{
{
EvaluateJSReply::NumberValue(
if let Some(e) = FromJSValConvertible::from_jsval(cx, rval.handle(), ()) {
unimplemented!();
},
)
}
}
}
}
fn keep_for() {
{
{
{
EvaluateJSReply::NumberValue(
for conv in FromJSValConvertible::from_jsval(cx, rval.handle(), ()) {
unimplemented!();
},
)
}
}
}
}
fn keep_loop() {
{
{
{
EvaluateJSReply::NumberValue(loop {
FromJSValConvertible::from_jsval(cx, rval.handle(), ());
})
}
}
}
}
fn keep_while() {
{
{
{
EvaluateJSReply::NumberValue(
while FromJSValConvertible::from_jsval(cx, rval.handle(), ()) {
unimplemented!();
},
)
}
}
}
}
fn keep_while_let() {
{
{
{
EvaluateJSReply::NumberValue(
while let Some(e) = FromJSValConvertible::from_jsval(cx, rval.handle(), ()) {
unimplemented!();
},
)
}
}
}
}
fn keep_match() {
{
{
EvaluateJSReply::NumberValue(
match FromJSValConvertible::from_jsval(cx, rval.handle(), ()) {
Ok(ConversionResult::Success(v)) => v,
_ => unreachable!(),
},
)
}
}
}