rust/compiler/rustc_ast/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
..
attr rustc_ast: replace some len-checks + indexing with slice patterns etc. 🧹 2025-01-26 16:26:52 +00:00
expand clean up autodiff code/comments 2025-02-21 21:47:48 -05:00
util Introduce AssocOp::Binary. 2025-02-27 09:53:17 +11:00
ast_traits.rs Remove NtTy. 2025-02-21 15:49:46 +11:00
ast.rs Introduce AssocOp::Binary. 2025-02-27 09:53:17 +11:00
entry.rs remove support for the #[start] attribute 2025-01-21 06:59:15 -07:00
format.rs Account for format_args in HiddenUnicodeCodepoints lint 2024-12-31 05:03:22 +00:00
lib.rs Add hir::Attribute 2024-12-15 19:18:46 +01:00
mut_visit.rs Remove NtTy. 2025-02-21 15:49:46 +11:00
node_id.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
ptr.rs Convert some Into impls into From impls 2024-12-31 01:56:33 +00:00
token.rs Avoid snapshotting the parser in parse_path_inner. 2025-02-21 16:48:01 +11:00
tokenstream.rs Remove NtTy. 2025-02-21 15:49:46 +11:00
visit.rs Fix binding mode problems 2025-02-22 00:13:19 +00:00