Rollup merge of #98980 - RalfJung:const-prop-ice, r=oli-obk
fix ICE in ConstProp Fixes https://github.com/rust-lang/rust/issues/96169
This commit is contained in:
commit
a6c6166d7b
6 changed files with 39 additions and 12 deletions
|
@ -22,8 +22,8 @@ use rustc_middle::ty::{
|
|||
self, ConstKind, EarlyBinder, Instance, ParamEnv, Ty, TyCtxt, TypeVisitable,
|
||||
};
|
||||
use rustc_span::{def_id::DefId, Span};
|
||||
use rustc_target::abi::{HasDataLayout, Size, TargetDataLayout};
|
||||
use rustc_target::spec::abi::Abi;
|
||||
use rustc_target::abi::{self, HasDataLayout, Size, TargetDataLayout};
|
||||
use rustc_target::spec::abi::Abi as CallAbi;
|
||||
use rustc_trait_selection::traits;
|
||||
|
||||
use crate::MirPass;
|
||||
|
@ -195,7 +195,7 @@ impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for ConstPropMachine<'mir, 'tcx>
|
|||
fn find_mir_or_eval_fn(
|
||||
_ecx: &mut InterpCx<'mir, 'tcx, Self>,
|
||||
_instance: ty::Instance<'tcx>,
|
||||
_abi: Abi,
|
||||
_abi: CallAbi,
|
||||
_args: &[OpTy<'tcx>],
|
||||
_destination: &PlaceTy<'tcx>,
|
||||
_target: Option<BasicBlock>,
|
||||
|
@ -659,6 +659,11 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
|
|||
(Ok(_), Ok(_)) => return this.ecx.eval_rvalue_into_place(rvalue, place),
|
||||
};
|
||||
|
||||
if !matches!(const_arg.layout.abi, abi::Abi::Scalar(..)) {
|
||||
// We cannot handle Scalar Pair stuff.
|
||||
return this.ecx.eval_rvalue_into_place(rvalue, place);
|
||||
}
|
||||
|
||||
let arg_value = const_arg.to_scalar()?.to_bits(const_arg.layout.size)?;
|
||||
let dest = this.ecx.eval_place(place)?;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue