rust/compiler/rustc_ast_pretty/src
Nicholas Nethercote ceafbad81f Introduce AssocOp::Binary.
It mirrors `ExprKind::Binary`, and contains a `BinOpKind`. This makes
`AssocOp` more like `ExprKind`. Note that the variants removed from
`AssocOp` are all named differently to `BinOpToken`, e.g. `Multiply`
instead of `Mul`, so that's an inconsistency removed.

The commit adds `precedence` and `fixity` methods to `BinOpKind`, and
calls them from the corresponding methods in `AssocOp`. This avoids the
need to create an `AssocOp` from a `BinOpKind` in a bunch of places, and
`AssocOp::from_ast_binop` is removed.

`AssocOp::to_ast_binop` is also no longer needed.

Overall things are shorter and nicer.
2025-02-27 09:53:17 +11:00
..
pp Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
pprust Introduce AssocOp::Binary. 2025-02-27 09:53:17 +11:00
helpers.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
lib.rs Add warn(unreachable_pub) to rustc_ast_pretty. 2024-08-16 08:46:46 +10:00
pp.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00