1
Fork 0

Rollup merge of #119004 - matthiaskrgr:conv, r=compiler-errors

NFC don't convert types to identical types
This commit is contained in:
Jubilee 2023-12-15 21:33:00 -08:00 committed by GitHub
commit c5a3d98cc6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 35 additions and 50 deletions

View file

@ -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)