diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-12-19 16:24:06 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-02-27 09:47:22 +1100 |
| commit | 8f001eaf62ca469887db7c9b47b6feb94cef597c (patch) | |
| tree | 1a8f3968c2654362b4516d5ecb6382fb6a035cf4 /tests/codegen-llvm/src-hash-algorithm | |
| parent | 17bda0c0febb8c51fb14a6856d365eab86fc6162 (diff) | |
| download | rust-8f001eaf62ca469887db7c9b47b6feb94cef597c.tar.gz rust-8f001eaf62ca469887db7c9b47b6feb94cef597c.zip | |
In `AssocOp::AssignOp`, use `BinOpKind` instead of `BinOpToken`
`AssocOp::AssignOp` contains a `BinOpToken`. `ExprKind::AssignOp` contains a `BinOpKind`. Given that `AssocOp` is basically a cut-down version of `ExprKind`, it makes sense to make `AssocOp` more like `ExprKind`. Especially given that `AssocOp` and `BinOpKind` use semantic operation names (e.g. `Mul`, `Div`), but `BinOpToken` uses syntactic names (e.g. `Star`, `Slash`). This results in more concise code, and removes the need for various conversions. (Note that the removed functions `hirbinop2assignop` and `astbinop2assignop` are semantically identical, because `hir::BinOp` is just a synonum for `ast::BinOp`!) The only downside to this is that it allows the possibility of some nonsensical combinations, such as `AssocOp::AssignOp(BinOpKind::Lt)`. But `ExprKind::AssignOp` already has that problem. The problem can be fixed for both types in the future with some effort, by introducing an `AssignOpKind` type.
Diffstat (limited to 'tests/codegen-llvm/src-hash-algorithm')
0 files changed, 0 insertions, 0 deletions
