Sync from rust bb93450ec4
This commit is contained in:
commit
7bf4e19cc1
@ -635,7 +635,12 @@ fn codegen_stmt<'tcx>(
|
|||||||
lval.write_cvalue(fx, operand.cast_pointer_to(to_layout));
|
lval.write_cvalue(fx, operand.cast_pointer_to(to_layout));
|
||||||
}
|
}
|
||||||
Rvalue::Cast(
|
Rvalue::Cast(
|
||||||
CastKind::Misc
|
CastKind::IntToInt
|
||||||
|
| CastKind::FloatToFloat
|
||||||
|
| CastKind::FloatToInt
|
||||||
|
| CastKind::IntToFloat
|
||||||
|
| CastKind::FnPtrToPtr
|
||||||
|
| CastKind::PtrToPtr
|
||||||
| CastKind::PointerExposeAddress
|
| CastKind::PointerExposeAddress
|
||||||
| CastKind::PointerFromExposedAddress,
|
| CastKind::PointerFromExposedAddress,
|
||||||
ref operand,
|
ref operand,
|
||||||
|
@ -481,7 +481,16 @@ pub(crate) fn mir_operand_get_const_val<'tcx>(
|
|||||||
match &stmt.kind {
|
match &stmt.kind {
|
||||||
StatementKind::Assign(local_and_rvalue) if &local_and_rvalue.0 == place => {
|
StatementKind::Assign(local_and_rvalue) if &local_and_rvalue.0 == place => {
|
||||||
match &local_and_rvalue.1 {
|
match &local_and_rvalue.1 {
|
||||||
Rvalue::Cast(CastKind::Misc, operand, ty) => {
|
Rvalue::Cast(
|
||||||
|
CastKind::IntToInt
|
||||||
|
| CastKind::FloatToFloat
|
||||||
|
| CastKind::FloatToInt
|
||||||
|
| CastKind::IntToFloat
|
||||||
|
| CastKind::FnPtrToPtr
|
||||||
|
| CastKind::PtrToPtr,
|
||||||
|
operand,
|
||||||
|
ty,
|
||||||
|
) => {
|
||||||
if computed_const_val.is_some() {
|
if computed_const_val.is_some() {
|
||||||
return None; // local assigned twice
|
return None; // local assigned twice
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user