mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-18 18:53:04 +00:00
check only first statement
This commit is contained in:
parent
f411c18a73
commit
7a83809c8c
@ -372,11 +372,13 @@ fn eq_stmts(
|
||||
}
|
||||
|
||||
fn contains_acceptable_macro(cx: &LateContext<'_>, block: &Block<'_>) -> bool {
|
||||
for stmt in block.stmts {
|
||||
match stmt.kind {
|
||||
StmtKind::Semi(semi_expr) if acceptable_macro(cx, semi_expr) => return true,
|
||||
_ => {},
|
||||
}
|
||||
if block.stmts.first().map_or(false, |stmt|
|
||||
matches!(
|
||||
stmt.kind,
|
||||
StmtKind::Semi(semi_expr) if acceptable_macro(cx, semi_expr)
|
||||
)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if let Some(block_expr) = block.expr
|
||||
|
@ -179,38 +179,6 @@ mod issue_8836 {
|
||||
} else {
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
if true {
|
||||
println!("FOO");
|
||||
todo!();
|
||||
} else {
|
||||
println!("FOO");
|
||||
todo!();
|
||||
}
|
||||
|
||||
if true {
|
||||
println!("FOO");
|
||||
unimplemented!();
|
||||
} else {
|
||||
println!("FOO");
|
||||
unimplemented!();
|
||||
}
|
||||
|
||||
if true {
|
||||
println!("FOO");
|
||||
todo!()
|
||||
} else {
|
||||
println!("FOO");
|
||||
todo!()
|
||||
}
|
||||
|
||||
if true {
|
||||
println!("FOO");
|
||||
unimplemented!()
|
||||
} else {
|
||||
println!("FOO");
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user