Auto merge of #122045 - matthiaskrgr:rollup-5l3vpn7, r=matthiaskrgr
Rollup of 9 pull requests Successful merges: - #121065 (Add basic i18n guidance for `Display`) - #121744 (Stop using Bubble in coherence and instead emulate it with an intercrate check) - #121829 (Dummy tweaks (attempt 2)) - #121857 (Implement async closure signature deduction) - #121894 (const_eval_select: make it safe but be careful with what we expose on stable for now) - #122014 (Change some attributes to only_local.) - #122016 (will_wake tests fail on Miri and that is expected) - #122018 (only set noalias on Box with the global allocator) - #122028 (Remove some dead code) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
b77e0184a9
44 changed files with 291 additions and 133 deletions
|
@ -437,6 +437,7 @@ where
|
|||
trace!("deref to {} on {:?}", val.layout.ty, *val);
|
||||
|
||||
if val.layout.ty.is_box() {
|
||||
// Derefer should have removed all Box derefs
|
||||
bug!("dereferencing {}", val.layout.ty);
|
||||
}
|
||||
|
||||
|
|
|
@ -359,14 +359,8 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
|||
Ok(Some(match ty.kind() {
|
||||
ty::Ref(_, ty, _) => *ty,
|
||||
ty::RawPtr(mt) => mt.ty,
|
||||
// We should only accept `Box` with the default allocator.
|
||||
// It's hard to test for that though so we accept every 1-ZST allocator.
|
||||
ty::Adt(def, args)
|
||||
if def.is_box()
|
||||
&& self.layout_of(args[1].expect_ty()).is_ok_and(|l| l.is_1zst()) =>
|
||||
{
|
||||
args[0].expect_ty()
|
||||
}
|
||||
// We only accept `Box` with the default allocator.
|
||||
_ if ty.is_box_global(*self.tcx) => ty.boxed_ty(),
|
||||
_ => return Ok(None),
|
||||
}))
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue