about summary refs log tree commit diff
path: root/tests/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2023-09-21 13:25:39 +0200
committerGitHub <noreply@github.com>2023-09-21 13:25:39 +0200
commit12815e95f99fe17f1782eeffd4159738c730d1c4 (patch)
treee4decf2bd4304fe86745d044d0a7f278ba9f31e2 /tests/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs
parent238dc2828ed4b2ce49a95b8093486cd01c528af9 (diff)
parent2ea6ac5673931cd0804507ebe57452914d76f552 (diff)
downloadrust-12815e95f99fe17f1782eeffd4159738c730d1c4.tar.gz
rust-12815e95f99fe17f1782eeffd4159738c730d1c4.zip
Rollup merge of #115972 - RalfJung:const-consistency, r=oli-obk
rename mir::Constant -> mir::ConstOperand, mir::ConstKind -> mir::Const

Also, be more consistent with the `to/eval_bits` methods... we had some that take a type and some that take a size, and then sometimes the one that takes a type is called `bits_for_ty`.

Turns out that `ty::Const`/`mir::ConstKind` carry their type with them, so we don't need to even pass the type to those `eval_bits` functions at all.

However this is not properly consistent yet: in `ty` we have most of the methods on `ty::Const`, but in `mir` we have them on `mir::ConstKind`. And indeed those two types are the ones that correspond to each other. So `mir::ConstantKind` should actually be renamed to `mir::Const`. But what to do with `mir::Constant`? It carries around a span, that's really more like a constant operand that appears as a MIR operand... it's more suited for `syntax.rs` than `consts.rs`, but the bigger question is, which name should it get if we want to align the `mir` and `ty` types? `ConstOperand`? `ConstOp`? `Literal`? It's not a literal but it has a field called `literal` so it would at least be consistently wrong-ish...

``@oli-obk`` any ideas?
Diffstat (limited to 'tests/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs')
0 files changed, 0 insertions, 0 deletions