Merge commit '370c397ec9
' into sync_cg_clif-2022-03-20
This commit is contained in:
commit
ef4ce72919
32 changed files with 462 additions and 515 deletions
|
@ -68,11 +68,10 @@ pub(crate) fn codegen_get_discriminant<'tcx>(
|
|||
let layout = value.layout();
|
||||
|
||||
if layout.abi == Abi::Uninhabited {
|
||||
return trap_unreachable_ret_value(
|
||||
fx,
|
||||
dest_layout,
|
||||
"[panic] Tried to get discriminant for uninhabited type.",
|
||||
);
|
||||
let true_ = fx.bcx.ins().iconst(types::I32, 1);
|
||||
fx.bcx.ins().trapnz(true_, TrapCode::UnreachableCodeReached);
|
||||
// Return a dummy value
|
||||
return CValue::by_ref(Pointer::const_addr(fx, 0), dest_layout);
|
||||
}
|
||||
|
||||
let (tag_scalar, tag_field, tag_encoding) = match &layout.variants {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue