Skip to content

Commit acb32e6

Browse files
committed
Sync from rust 1dec35a
2 parents a177a7f + a923e92 commit acb32e6

File tree

6 files changed

+7
-5
lines changed

6 files changed

+7
-5
lines changed

src/base.rs

+1
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,7 @@ fn codegen_stmt<'tcx>(
772772
}
773773
StatementKind::StorageLive(_)
774774
| StatementKind::StorageDead(_)
775+
| StatementKind::Deinit(_)
775776
| StatementKind::Nop
776777
| StatementKind::FakeRead(..)
777778
| StatementKind::Retag { .. }

src/common.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub(crate) fn pointer_ty(tcx: TyCtxt<'_>) -> types::Type {
2121
}
2222

2323
pub(crate) fn scalar_to_clif_type(tcx: TyCtxt<'_>, scalar: Scalar) -> Type {
24-
match scalar.value {
24+
match scalar.primitive() {
2525
Primitive::Int(int, _sign) => match int {
2626
Integer::I8 => types::I8,
2727
Integer::I16 => types::I16,

src/constant.rs

+1
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,7 @@ pub(crate) fn mir_operand_get_const_val<'tcx>(
518518
StatementKind::Assign(_)
519519
| StatementKind::FakeRead(_)
520520
| StatementKind::SetDiscriminant { .. }
521+
| StatementKind::Deinit(_)
521522
| StatementKind::StorageLive(_)
522523
| StatementKind::StorageDead(_)
523524
| StatementKind::Retag(_, _)

src/discriminant.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ pub(crate) fn codegen_get_discriminant<'tcx>(
105105
// Decode the discriminant (specifically if it's niche-encoded).
106106
match *tag_encoding {
107107
TagEncoding::Direct => {
108-
let signed = match tag_scalar.value {
108+
let signed = match tag_scalar.primitive() {
109109
Int(_, signed) => signed,
110110
_ => false,
111111
};

src/driver/jit.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,8 @@ fn load_imported_symbols_for_jit(
288288
match data[cnum.as_usize() - 1] {
289289
Linkage::NotLinked | Linkage::IncludedFromDylib => {}
290290
Linkage::Static => {
291-
let name = &crate_info.crate_name[&cnum];
292-
let mut err = sess.struct_err(&format!("Can't load static lib {}", name.as_str()));
291+
let name = crate_info.crate_name[&cnum];
292+
let mut err = sess.struct_err(&format!("Can't load static lib {}", name));
293293
err.note("rustc_codegen_cranelift can only load dylibs in JIT mode.");
294294
err.emit();
295295
}

src/value_and_place.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ fn codegen_field<'tcx>(
5050
}
5151

5252
fn scalar_pair_calculate_b_offset(tcx: TyCtxt<'_>, a_scalar: Scalar, b_scalar: Scalar) -> Offset32 {
53-
let b_offset = a_scalar.value.size(&tcx).align_to(b_scalar.value.align(&tcx).abi);
53+
let b_offset = a_scalar.size(&tcx).align_to(b_scalar.align(&tcx).abi);
5454
Offset32::new(b_offset.bytes().try_into().unwrap())
5555
}
5656

0 commit comments

Comments
 (0)