mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-17 09:23:05 +00:00
parent
d594910a2d
commit
6b7fcf720a
@ -476,8 +476,11 @@ trait UnusedDelimLint {
|
||||
|
||||
lhs_needs_parens
|
||||
|| (followed_by_block
|
||||
&& match inner.kind {
|
||||
&& match &inner.kind {
|
||||
ExprKind::Ret(_) | ExprKind::Break(..) | ExprKind::Yield(..) => true,
|
||||
ExprKind::Range(_lhs, Some(rhs), _limits) => {
|
||||
!classify::expr_requires_semi_to_be_stmt(&rhs)
|
||||
}
|
||||
_ => parser::contains_exterior_struct_lit(&inner),
|
||||
})
|
||||
}
|
||||
|
8
src/test/ui/lint/unused/issue-90807-unused-paren.rs
Normal file
8
src/test/ui/lint/unused/issue-90807-unused-paren.rs
Normal file
@ -0,0 +1,8 @@
|
||||
// check-pass
|
||||
// Make sure unused parens lint doesn't emit a false positive.
|
||||
// See https://github.com/rust-lang/rust/issues/90807
|
||||
#![deny(unused_parens)]
|
||||
|
||||
fn main() {
|
||||
for _ in (1..{ 2 }) {}
|
||||
}
|
Loading…
Reference in New Issue
Block a user