about summary refs log tree commit diff
path: root/tests/codegen-llvm/src-hash-algorithm/src-hash-algorithm-md5.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-12-19 16:24:06 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2025-02-27 09:47:22 +1100
commit8f001eaf62ca469887db7c9b47b6feb94cef597c (patch)
tree1a8f3968c2654362b4516d5ecb6382fb6a035cf4 /tests/codegen-llvm/src-hash-algorithm/src-hash-algorithm-md5.rs
parent17bda0c0febb8c51fb14a6856d365eab86fc6162 (diff)
downloadrust-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/src-hash-algorithm-md5.rs')
0 files changed, 0 insertions, 0 deletions