Support allocation failures when interperting MIR

Note that this breaks Miri.

Closes #79601
This commit is contained in:
Smitty 2021-06-12 19:49:48 -04:00
parent 6e0b554619
commit 524e575bb4
19 changed files with 103 additions and 39 deletions

View file

@ -48,7 +48,7 @@ fn eval_body_using_ecx<'mir, 'tcx>(
);
let layout = ecx.layout_of(body.return_ty().subst(tcx, cid.instance.substs))?;
assert!(!layout.is_unsized());
let ret = ecx.allocate(layout, MemoryKind::Stack);
let ret = ecx.allocate(layout, MemoryKind::Stack)?;
let name =
with_no_trimmed_paths(|| ty::tls::with(|tcx| tcx.def_path_str(cid.instance.def_id())));