Rollup merge of #119004 - matthiaskrgr:conv, r=compiler-errors
NFC don't convert types to identical types
This commit is contained in:
commit
c5a3d98cc6
24 changed files with 35 additions and 50 deletions
|
@ -1557,7 +1557,7 @@ impl Expr<'_> {
|
|||
ExprKind::Call(..) => ExprPrecedence::Call,
|
||||
ExprKind::MethodCall(..) => ExprPrecedence::MethodCall,
|
||||
ExprKind::Tup(_) => ExprPrecedence::Tup,
|
||||
ExprKind::Binary(op, ..) => ExprPrecedence::Binary(op.node.into()),
|
||||
ExprKind::Binary(op, ..) => ExprPrecedence::Binary(op.node),
|
||||
ExprKind::Unary(..) => ExprPrecedence::Unary,
|
||||
ExprKind::Lit(_) => ExprPrecedence::Lit,
|
||||
ExprKind::Type(..) | ExprKind::Cast(..) => ExprPrecedence::Cast,
|
||||
|
@ -1697,11 +1697,9 @@ impl Expr<'_> {
|
|||
// them being used only for its side-effects.
|
||||
base.can_have_side_effects()
|
||||
}
|
||||
ExprKind::Struct(_, fields, init) => fields
|
||||
.iter()
|
||||
.map(|field| field.expr)
|
||||
.chain(init.into_iter())
|
||||
.any(|e| e.can_have_side_effects()),
|
||||
ExprKind::Struct(_, fields, init) => {
|
||||
fields.iter().map(|field| field.expr).chain(init).any(|e| e.can_have_side_effects())
|
||||
}
|
||||
|
||||
ExprKind::Array(args)
|
||||
| ExprKind::Tup(args)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue