]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Auto merge of #94255 - b-naber:use-mir-constant-in-thir, r=oli-obk
authorbors <bors@rust-lang.org>
Wed, 13 Apr 2022 07:50:56 +0000 (07:50 +0000)
committerbors <bors@rust-lang.org>
Wed, 13 Apr 2022 07:50:56 +0000 (07:50 +0000)
commite3c43e64eceb00e13b1932229aa9b2d774e6af96
tree201b9089a76e563c8cebee025338892fdcf6c82d
parentb768f248e99688a2d7649731a99b2f2ad962abf5
parent3be987e076ad6b90a3679036ff71f639e9553ffa
Auto merge of #94255 - b-naber:use-mir-constant-in-thir, r=oli-obk

Use mir constant in thir instead of ty::Const

This is blocked on https://github.com/rust-lang/rust/pull/94059 (does include its changes, the first two commits in this PR correspond to those changes) and https://github.com/rust-lang/rust/pull/93800 being reinstated (which had to be reverted). Mainly opening since `@lcnr` offered to give some feedback and maybe also for a perf-run (if necessary).

This currently contains a lot of duplication since some of the logic of `ty::Const` had to be copied to `mir::ConstantKind`, but with the introduction of valtrees a lot of that functionality will disappear from `ty::Const`.

Only the last commit contains changes that need to be reviewed here. Did leave some `FIXME` comments regarding future implementation decisions and some things that might be incorrectly implemented.

r? `@oli-obk`
compiler/rustc_middle/src/mir/mod.rs
compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs
compiler/rustc_trait_selection/src/traits/const_evaluatable.rs