diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2023-10-08 09:22:39 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2023-10-08 09:22:39 +0000 |
| commit | 1906ec56fce048588b319bfbc97126ba9d8c5de2 (patch) | |
| tree | 28563e8b6928d57bb347bc71cf334bce1201eec3 | |
| parent | e759603da1d281890cac241f244d2288c127b355 (diff) | |
| parent | c9f6ac45d9a57e60ed4b2d63c96af49be2219ba1 (diff) | |
| download | rust-1906ec56fce048588b319bfbc97126ba9d8c5de2.tar.gz rust-1906ec56fce048588b319bfbc97126ba9d8c5de2.zip | |
Sync from rust 97c81e1b537088f1881c8894ee8579812ed9b6d1
| -rw-r--r-- | scripts/setup_rust_fork.sh | 2 | ||||
| -rw-r--r-- | src/abi/mod.rs | 2 | ||||
| -rw-r--r-- | src/base.rs | 12 | ||||
| -rw-r--r-- | src/value_and_place.rs | 10 |
4 files changed, 13 insertions, 13 deletions
diff --git a/scripts/setup_rust_fork.sh b/scripts/setup_rust_fork.sh index e6bbac647e5..f09b9ef12de 100644 --- a/scripts/setup_rust_fork.sh +++ b/scripts/setup_rust_fork.sh @@ -31,7 +31,7 @@ index d95b5b7f17f..00b6f0e3635 100644 EOF cat > config.toml <<EOF -changelog-seen = 2 +change-id = 115898 [llvm] ninja = false diff --git a/src/abi/mod.rs b/src/abi/mod.rs index bd56c3bd34c..c75ad852f82 100644 --- a/src/abi/mod.rs +++ b/src/abi/mod.rs @@ -28,7 +28,7 @@ fn clif_sig_from_fn_abi<'tcx>( let inputs = fn_abi.args.iter().flat_map(|arg_abi| arg_abi.get_abi_param(tcx).into_iter()); let (return_ptr, returns) = fn_abi.ret.get_abi_return(tcx); - // Sometimes the first param is an pointer to the place where the return value needs to be stored. + // Sometimes the first param is a pointer to the place where the return value needs to be stored. let params: Vec<_> = return_ptr.into_iter().chain(inputs).collect(); Signature { params, returns, call_conv } diff --git a/src/base.rs b/src/base.rs index 43afba6322f..ac7389792c8 100644 --- a/src/base.rs +++ b/src/base.rs @@ -249,17 +249,6 @@ pub(crate) fn verify_func( } fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) { - if let Err(err) = - fx.mir.post_mono_checks(fx.tcx, ty::ParamEnv::reveal_all(), |c| Ok(fx.monomorphize(c))) - { - err.emit_err(fx.tcx); - fx.bcx.append_block_params_for_function_params(fx.block_map[START_BLOCK]); - fx.bcx.switch_to_block(fx.block_map[START_BLOCK]); - // compilation should have been aborted - fx.bcx.ins().trap(TrapCode::UnreachableCodeReached); - return; - } - let arg_uninhabited = fx .mir .args_iter() @@ -875,6 +864,7 @@ pub(crate) fn codegen_place<'tcx>( cplace = cplace.place_deref(fx); } PlaceElem::OpaqueCast(ty) => bug!("encountered OpaqueCast({ty}) in codegen"), + PlaceElem::Subtype(ty) => cplace = cplace.place_transmute_type(fx, fx.monomorphize(ty)), PlaceElem::Field(field, _ty) => { cplace = cplace.place_field(fx, field); } diff --git a/src/value_and_place.rs b/src/value_and_place.rs index bc7a6f1d591..3a6a6c9e3f5 100644 --- a/src/value_and_place.rs +++ b/src/value_and_place.rs @@ -674,6 +674,16 @@ impl<'tcx> CPlace<'tcx> { } } + /// Used for `ProjectionElem::Subtype`, `ty` has to be monomorphized before + /// passed on. + pub(crate) fn place_transmute_type( + self, + fx: &mut FunctionCx<'_, '_, 'tcx>, + ty: Ty<'tcx>, + ) -> CPlace<'tcx> { + CPlace { inner: self.inner, layout: fx.layout_of(ty) } + } + pub(crate) fn place_field( self, fx: &mut FunctionCx<'_, '_, 'tcx>, |
