Skip to content

Commit 446c582

Browse files
committed
Sync from rust dd84b7d
2 parents ad2b9ac + 5e58dc1 commit 446c582

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

src/base.rs

-6
Original file line numberDiff line numberDiff line change
@@ -828,12 +828,6 @@ fn codegen_stmt<'tcx>(
828828
fx.bcx.ins().nop();
829829
}
830830
}
831-
Rvalue::Len(place) => {
832-
let place = codegen_place(fx, place);
833-
let usize_layout = fx.layout_of(fx.tcx.types.usize);
834-
let len = codegen_array_len(fx, place);
835-
lval.write_cvalue(fx, CValue::by_val(len, usize_layout));
836-
}
837831
Rvalue::ShallowInitBox(ref operand, content_ty) => {
838832
let content_ty = fx.monomorphize(content_ty);
839833
let box_layout = fx.layout_of(Ty::new_box(fx.tcx, content_ty));

src/compiler_builtins.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::ffi::c_int;
33
#[cfg(feature = "jit")]
44
use std::ffi::c_void;
55

6-
// FIXME replace with core::ffi::c_size_t once stablized
6+
// FIXME replace with core::ffi::c_size_t once stabilized
77
#[allow(non_camel_case_types)]
88
#[cfg(feature = "jit")]
99
type size_t = usize;

src/discriminant.rs

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ pub(crate) fn codegen_set_discriminant<'tcx>(
1818
return;
1919
}
2020
match layout.variants {
21+
Variants::Empty => unreachable!("we already handled uninhabited types"),
2122
Variants::Single { index } => {
2223
assert_eq!(index, variant_index);
2324
}
@@ -85,6 +86,7 @@ pub(crate) fn codegen_get_discriminant<'tcx>(
8586
}
8687

8788
let (tag_scalar, tag_field, tag_encoding) = match &layout.variants {
89+
Variants::Empty => unreachable!("we already handled uninhabited types"),
8890
Variants::Single { index } => {
8991
let discr_val = layout
9092
.ty

src/driver/jit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ fn dep_symbol_lookup_fn(
294294
// search path.
295295
for &cnum in crate_info.used_crates.iter().rev() {
296296
let src = &crate_info.used_crate_source[&cnum];
297-
match data[cnum.as_usize() - 1] {
297+
match data[cnum] {
298298
Linkage::NotLinked | Linkage::IncludedFromDylib => {}
299299
Linkage::Static => {
300300
let name = crate_info.crate_name[&cnum];

0 commit comments

Comments
 (0)