Skip to content

Commit b01a977

Browse files
committedJul 18, 2024
Auto merge of #127906 - tgross35:rollup-41bhgce, r=tgross35
Rollup of 7 pull requests Successful merges: - #127491 (Migrate 8 very similar FFI `run-make` tests to rmake) - #127687 (Const-to-pattern-to-MIR cleanup) - #127822 (Migrate `issue-85401-static-mir`, `missing-crate-dependency` and `unstable-flag-required` `run-make` tests to rmake) - #127842 (Remove `TrailingToken`.) - #127864 (cleanup: remove support for 3DNow! cpu features) - #127899 (Mark myself as on leave) - #127901 (Add missing GHA group for building `llvm-bitcode-linker`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 52f3c71 + 16d2b61 commit b01a977

File tree

78 files changed

+551
-831
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+551
-831
lines changed
 

‎Cargo.lock

+1
Original file line numberDiff line numberDiff line change
@@ -4411,6 +4411,7 @@ dependencies = [
44114411
name = "rustc_mir_build"
44124412
version = "0.0.0"
44134413
dependencies = [
4414+
"either",
44144415
"itertools",
44154416
"rustc_apfloat",
44164417
"rustc_arena",

‎compiler/rustc_codegen_ssa/src/mir/constant.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
3737
pub fn eval_unevaluated_mir_constant_to_valtree(
3838
&self,
3939
constant: &mir::ConstOperand<'tcx>,
40-
) -> Result<Option<ty::ValTree<'tcx>>, ErrorHandled> {
40+
) -> Result<Result<ty::ValTree<'tcx>, Ty<'tcx>>, ErrorHandled> {
4141
let uv = match self.monomorphize(constant.const_) {
4242
mir::Const::Unevaluated(uv, _) => uv.shrink(),
4343
mir::Const::Ty(_, c) => match c.kind() {
4444
// A constant that came from a const generic but was then used as an argument to old-style
4545
// simd_shuffle (passing as argument instead of as a generic param).
46-
rustc_type_ir::ConstKind::Value(_, valtree) => return Ok(Some(valtree)),
46+
rustc_type_ir::ConstKind::Value(_, valtree) => return Ok(Ok(valtree)),
4747
other => span_bug!(constant.span, "{other:#?}"),
4848
},
4949
// We should never encounter `Const::Val` unless MIR opts (like const prop) evaluate
@@ -70,6 +70,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
7070
let val = self
7171
.eval_unevaluated_mir_constant_to_valtree(constant)
7272
.ok()
73+
.map(|x| x.ok())
7374
.flatten()
7475
.map(|val| {
7576
let field_ty = ty.builtin_index().unwrap();

0 commit comments

Comments
 (0)