Sync from rust dd84b7d5ee
This commit is contained in:
commit
446c582ce0
4 changed files with 4 additions and 8 deletions
|
|
@ -828,12 +828,6 @@ fn codegen_stmt<'tcx>(
|
|||
fx.bcx.ins().nop();
|
||||
}
|
||||
}
|
||||
Rvalue::Len(place) => {
|
||||
let place = codegen_place(fx, place);
|
||||
let usize_layout = fx.layout_of(fx.tcx.types.usize);
|
||||
let len = codegen_array_len(fx, place);
|
||||
lval.write_cvalue(fx, CValue::by_val(len, usize_layout));
|
||||
}
|
||||
Rvalue::ShallowInitBox(ref operand, content_ty) => {
|
||||
let content_ty = fx.monomorphize(content_ty);
|
||||
let box_layout = fx.layout_of(Ty::new_box(fx.tcx, content_ty));
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ use std::ffi::c_int;
|
|||
#[cfg(feature = "jit")]
|
||||
use std::ffi::c_void;
|
||||
|
||||
// FIXME replace with core::ffi::c_size_t once stablized
|
||||
// FIXME replace with core::ffi::c_size_t once stabilized
|
||||
#[allow(non_camel_case_types)]
|
||||
#[cfg(feature = "jit")]
|
||||
type size_t = usize;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ pub(crate) fn codegen_set_discriminant<'tcx>(
|
|||
return;
|
||||
}
|
||||
match layout.variants {
|
||||
Variants::Empty => unreachable!("we already handled uninhabited types"),
|
||||
Variants::Single { index } => {
|
||||
assert_eq!(index, variant_index);
|
||||
}
|
||||
|
|
@ -85,6 +86,7 @@ pub(crate) fn codegen_get_discriminant<'tcx>(
|
|||
}
|
||||
|
||||
let (tag_scalar, tag_field, tag_encoding) = match &layout.variants {
|
||||
Variants::Empty => unreachable!("we already handled uninhabited types"),
|
||||
Variants::Single { index } => {
|
||||
let discr_val = layout
|
||||
.ty
|
||||
|
|
|
|||
|
|
@ -294,7 +294,7 @@ fn dep_symbol_lookup_fn(
|
|||
// search path.
|
||||
for &cnum in crate_info.used_crates.iter().rev() {
|
||||
let src = &crate_info.used_crate_source[&cnum];
|
||||
match data[cnum.as_usize() - 1] {
|
||||
match data[cnum] {
|
||||
Linkage::NotLinked | Linkage::IncludedFromDylib => {}
|
||||
Linkage::Static => {
|
||||
let name = crate_info.crate_name[&cnum];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue