mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-07 17:18:32 +03:00
Auto merge of #4135 - matthiaskrgr:rustup_obsol, r=phansch
rustup https://github.com/rust-lang/rust/pull/60803/ changelog: none
This commit is contained in:
@@ -136,7 +136,6 @@ pub fn ast(cx: &EarlyContext<'_>, expr: &ast::Expr, default: &'a str) -> Self {
|
||||
| ast::ExprKind::Closure(..)
|
||||
| ast::ExprKind::If(..)
|
||||
| ast::ExprKind::IfLet(..)
|
||||
| ast::ExprKind::ObsoleteInPlace(..)
|
||||
| ast::ExprKind::Unary(..)
|
||||
| ast::ExprKind::Match(..) => Sugg::MaybeParen(snippet),
|
||||
ast::ExprKind::Async(..)
|
||||
@@ -385,7 +384,6 @@ fn needs_paren(op: &AssocOp, other: &AssocOp, dir: Associativity) -> bool {
|
||||
rhs
|
||||
),
|
||||
AssocOp::Assign => format!("{} = {}", lhs, rhs),
|
||||
AssocOp::ObsoleteInPlace => format!("in ({}) {}", lhs, rhs),
|
||||
AssocOp::AssignOp(op) => format!("{} {}= {}", lhs, token_to_string(&token::BinOp(op)), rhs),
|
||||
AssocOp::As => format!("{} as {}", lhs, rhs),
|
||||
AssocOp::DotDot => format!("{}..{}", lhs, rhs),
|
||||
@@ -425,7 +423,7 @@ fn associativity(op: &AssocOp) -> Associativity {
|
||||
use syntax::util::parser::AssocOp::*;
|
||||
|
||||
match *op {
|
||||
ObsoleteInPlace | Assign | AssignOp(_) => Associativity::Right,
|
||||
Assign | AssignOp(_) => Associativity::Right,
|
||||
Add | BitAnd | BitOr | BitXor | LAnd | LOr | Multiply | As | Colon => Associativity::Both,
|
||||
Divide | Equal | Greater | GreaterEqual | Less | LessEqual | Modulus | NotEqual | ShiftLeft | ShiftRight
|
||||
| Subtract => Associativity::Left,
|
||||
|
||||
Reference in New Issue
Block a user