rust/compiler/rustc_mir/src/interpret
bors 0978a9eb99 Auto merge of #83207 - oli-obk:valtree2, r=lcnr
normalize mir::Constant differently from ty::Const in preparation for valtrees

Valtrees are unable to represent many kind of constant values (this is on purpose). For constants that are used at runtime, we do not need a valtree representation and can thus use a different form of evaluation. In order to make this explicit and less fragile, I added a `fold_constant` method to `TypeFolder` and implemented it for normalization. Normalization can now, when it wants to eagerly evaluate a constant, normalize `mir::Constant` directly into a `mir::ConstantKind::Val` instead of relying on the `ty::Const` evaluation.

In the future we can get rid of the `ty::Const` in there entirely and add our own `Unevaluated` variant to `mir::ConstantKind`. This would allow us to remove the `promoted` field from `ty::ConstKind::Unevaluated`, as promoteds can never occur in the type system.

cc `@rust-lang/wg-const-eval`

r? `@lcnr`
2021-04-02 10:28:12 +00:00
..
intrinsics Add tcx lifetime to Binder 2021-03-31 10:13:57 -04:00
cast.rs Pass ImmTy by reference not value 2021-02-16 23:52:05 +01:00
eval_context.rs Auto merge of #83207 - oli-obk:valtree2, r=lcnr 2021-04-02 10:28:12 +00:00
intern.rs all InterpError allocate now, so adjust alloc-error-check 2021-02-20 19:01:25 +01:00
intrinsics.rs Forward some layouts to prevent recomputation 2021-03-31 10:40:45 +00:00
machine.rs Address more review comments 2021-03-27 22:19:32 -04:00
memory.rs Remove unwrap_none/expect_none from compiler/. 2021-03-18 14:25:54 +01:00
mod.rs interning cleanup: we no longer need to distinguish Const and ConstInner; we no longer need the ignore_interior_mut_in_const hack 2020-10-26 08:56:54 +01:00
operand.rs Auto merge of #83207 - oli-obk:valtree2, r=lcnr 2021-04-02 10:28:12 +00:00
operator.rs Pass PlaceTy by reference not value 2021-02-16 23:52:05 +01:00
place.rs Implement valtree 2021-03-12 12:16:14 +00:00
step.rs fix error message for copy(_nonoverlapping) overflow 2021-03-10 15:50:44 +01:00
terminator.rs rustc_target: add "unwind" payloads to Abi 2021-03-09 14:38:29 -05:00
traits.rs remove useless ?s (clippy::needless_question_marks) 2021-02-17 23:23:57 +01:00
util.rs Use Option::map_or instead of .map(..).unwrap_or(..) 2021-01-14 19:23:59 +01:00
validity.rs Replace closures_captures and upvar_capture with closure_min_captures 2021-03-18 20:45:49 -04:00
visitor.rs ./x.py fmt 2021-02-16 23:52:05 +01:00