rust/compiler/rustc_traits/src
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
..
chalk Add var to BoundRegion. Add query to get bound vars for applicable items. 2021-03-31 10:16:37 -04:00
dropck_outlives.rs Fix use of bare trait objects everywhere 2021-03-18 02:18:58 +03:00
evaluate_obligation.rs
implied_outlives_bounds.rs Review changes 2021-01-16 18:56:37 -05:00
lib.rs
normalize_erasing_regions.rs Add a new normalization query just for mir constants 2021-03-31 10:40:42 +00:00
normalize_projection_ty.rs
type_op.rs Review changes 2021-01-16 18:56:37 -05:00