Skip to content

Commit

Permalink
Auto merge of #130950 - compiler-errors:yeet-eval, r=BoxyUwU
Browse files Browse the repository at this point in the history
Continue to get rid of `ty::Const::{try_}eval*`

This PR mostly does:

* Removes all of the `try_eval_*` and `eval_*` helpers from `ty::Const`, and replace their usages with `try_to_*`.
* Remove `ty::Const::eval`.
* Rename `ty::Const::normalize` to `ty::Const::normalize_internal`. This function is still used in the normalization code itself.
* Fix some weirdness around the `TransmuteFrom` goal.

I'm happy to split it out further; for example, I could probably land the first part which removes the helpers, or the changes to codegen which are more obvious than the changes to tools.

r? BoxyUwU

Part of rust-lang/rust#130704
  • Loading branch information
bors committed Oct 21, 2024
2 parents ce8da11 + 1d635fe commit 76ca50d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/intrinsics/simd.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use either::Either;
use rustc_apfloat::{Float, Round};
use rustc_middle::ty::FloatTy;
use rustc_middle::ty::layout::{HasParamEnv, LayoutOf};
use rustc_middle::{mir, ty};
use rustc_middle::ty::layout::LayoutOf;
use rustc_middle::{mir, ty, ty::FloatTy};
use rustc_span::{Symbol, sym};
use rustc_target::abi::{Endian, HasDataLayout};

Expand Down Expand Up @@ -633,9 +632,9 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {

let index = generic_args[2]
.expect_const()
.eval(*this.tcx, this.param_env(), this.tcx.span)
.try_to_valtree()
.unwrap()
.1
.0
.unwrap_branch();
let index_len = index.len();

Expand Down

0 comments on commit 76ca50d

Please sign in to comment.