miri: do not apply aliasing restrictions to Box with custom allocator
This commit is contained in:
parent
1b427b3bf7
commit
e632e3f9a5
12 changed files with 250 additions and 35 deletions
|
@ -2008,13 +2008,10 @@ impl<'tcx> Ty<'tcx> {
|
|||
// Single-argument Box is always global. (for "minicore" tests)
|
||||
return true;
|
||||
};
|
||||
if let Some(alloc_adt) = alloc.expect_ty().ty_adt_def() {
|
||||
alloc.expect_ty().ty_adt_def().is_some_and(|alloc_adt| {
|
||||
let global_alloc = tcx.require_lang_item(LangItem::GlobalAlloc, None);
|
||||
alloc_adt.did() == global_alloc
|
||||
} else {
|
||||
// Allocator is not an ADT...
|
||||
false
|
||||
}
|
||||
})
|
||||
}
|
||||
_ => false,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue