Skip to content

Commit 1906ec5

Browse files
committed
Sync from rust 97c81e1
2 parents e759603 + c9f6ac4 commit 1906ec5

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

scripts/setup_rust_fork.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ index d95b5b7f17f..00b6f0e3635 100644
3131
EOF
3232

3333
cat > config.toml <<EOF
34-
changelog-seen = 2
34+
change-id = 115898
3535
3636
[llvm]
3737
ninja = false

src/abi/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fn clif_sig_from_fn_abi<'tcx>(
2828
let inputs = fn_abi.args.iter().flat_map(|arg_abi| arg_abi.get_abi_param(tcx).into_iter());
2929

3030
let (return_ptr, returns) = fn_abi.ret.get_abi_return(tcx);
31-
// Sometimes the first param is an pointer to the place where the return value needs to be stored.
31+
// Sometimes the first param is a pointer to the place where the return value needs to be stored.
3232
let params: Vec<_> = return_ptr.into_iter().chain(inputs).collect();
3333

3434
Signature { params, returns, call_conv }

src/base.rs

+1-11
Original file line numberDiff line numberDiff line change
@@ -249,17 +249,6 @@ pub(crate) fn verify_func(
249249
}
250250

251251
fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
252-
if let Err(err) =
253-
fx.mir.post_mono_checks(fx.tcx, ty::ParamEnv::reveal_all(), |c| Ok(fx.monomorphize(c)))
254-
{
255-
err.emit_err(fx.tcx);
256-
fx.bcx.append_block_params_for_function_params(fx.block_map[START_BLOCK]);
257-
fx.bcx.switch_to_block(fx.block_map[START_BLOCK]);
258-
// compilation should have been aborted
259-
fx.bcx.ins().trap(TrapCode::UnreachableCodeReached);
260-
return;
261-
}
262-
263252
let arg_uninhabited = fx
264253
.mir
265254
.args_iter()
@@ -875,6 +864,7 @@ pub(crate) fn codegen_place<'tcx>(
875864
cplace = cplace.place_deref(fx);
876865
}
877866
PlaceElem::OpaqueCast(ty) => bug!("encountered OpaqueCast({ty}) in codegen"),
867+
PlaceElem::Subtype(ty) => cplace = cplace.place_transmute_type(fx, fx.monomorphize(ty)),
878868
PlaceElem::Field(field, _ty) => {
879869
cplace = cplace.place_field(fx, field);
880870
}

src/value_and_place.rs

+10
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,16 @@ impl<'tcx> CPlace<'tcx> {
674674
}
675675
}
676676

677+
/// Used for `ProjectionElem::Subtype`, `ty` has to be monomorphized before
678+
/// passed on.
679+
pub(crate) fn place_transmute_type(
680+
self,
681+
fx: &mut FunctionCx<'_, '_, 'tcx>,
682+
ty: Ty<'tcx>,
683+
) -> CPlace<'tcx> {
684+
CPlace { inner: self.inner, layout: fx.layout_of(ty) }
685+
}
686+
677687
pub(crate) fn place_field(
678688
self,
679689
fx: &mut FunctionCx<'_, '_, 'tcx>,

0 commit comments

Comments
 (0)