Auto merge of #119274 - RalfJung:raw-ptr-pattern-ice, r=compiler-errors

fix ICE when using raw ptr in a pattern

Fixes https://github.com/rust-lang/rust/issues/119270
This commit is contained in:
bors 2023-12-25 00:03:59 +00:00
commit 471dcbdb09
3 changed files with 34 additions and 1 deletions

View file

@ -341,7 +341,7 @@ fn valtree_into_mplace<'tcx>(
ty::FnDef(_, _) => {
// Zero-sized type, nothing to do.
}
ty::Bool | ty::Int(_) | ty::Uint(_) | ty::Float(_) | ty::Char => {
ty::Bool | ty::Int(_) | ty::Uint(_) | ty::Float(_) | ty::Char | ty::RawPtr(..) => {
let scalar_int = valtree.unwrap_leaf();
debug!("writing trivial valtree {:?} to place {:?}", scalar_int, place);
ecx.write_immediate(Immediate::Scalar(scalar_int.into()), place).unwrap();