u128
truncation and sign extension are not just interpreter related
This commit is contained in:
parent
e67c768110
commit
abacaf2aef
18 changed files with 73 additions and 89 deletions
|
@ -585,10 +585,7 @@ fn codegen_stmt<'tcx>(
|
|||
.discriminant_for_variant(fx.tcx, *index)
|
||||
.unwrap();
|
||||
let discr = if discr.ty.is_signed() {
|
||||
rustc_middle::mir::interpret::sign_extend(
|
||||
discr.val,
|
||||
fx.layout_of(discr.ty).size,
|
||||
)
|
||||
fx.layout_of(discr.ty).size.sign_extend(discr.val)
|
||||
} else {
|
||||
discr.val
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue