1
Fork 0
rust/compiler/rustc_const_eval/src
bors f893495e3d Auto merge of #98957 - RalfJung:zst-are-different, r=lcnr,oli-obk
don't allow ZST in ScalarInt

There are several indications that we should not ZST as a ScalarInt:
- We had two ways to have ZST valtrees, either an empty `Branch` or a `Leaf` with a ZST in it.
  `ValTree::zst()` used the former, but the latter could possibly arise as well.
- Likewise, the interpreter had `Immediate::Uninit` and `Immediate::Scalar(Scalar::ZST)`.
- LLVM codegen already had to special-case ZST ScalarInt.

So I propose we stop using ScalarInt to represent ZST (which are clearly not integers). Instead, we can add new ZST variants to those types that did not have other variants which could be used for this purpose.

Based on https://github.com/rust-lang/rust/pull/98831. Only the commits starting from "don't allow ZST in ScalarInt" are new.

r? `@oli-obk`
2022-07-09 17:16:00 +00:00
..
const_eval tweak names and output and bless 2022-07-09 07:43:56 -04:00
interpret Auto merge of #98957 - RalfJung:zst-are-different, r=lcnr,oli-obk 2022-07-09 17:16:00 +00:00
transform Rollup merge of #99050 - JakobDegen:storage-docs, r=tmiasko 2022-07-09 12:52:51 +02:00
util cleanup mir visitor for rustc::pass_by_value 2022-07-01 16:21:21 +02:00
errors.rs Migrate MutDeref, TransientMutBorrow diagnostics 2022-07-08 03:48:10 +00:00
lib.rs Migrate unstable-in-stable diagnostic 2022-07-08 03:39:08 +00:00