about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbjorn3 <bjorn3@users.noreply.github.com>2020-03-30 19:00:24 +0200
committerbjorn3 <bjorn3@users.noreply.github.com>2020-03-30 19:00:24 +0200
commit017a9b7641d291c7b23ffdcb0d8f305d6e9cad23 (patch)
tree10f4b6c64118f619c18d3e925dd95daf38c6ddcb /src
parent203b0b6b11842a2ff9281c797c1412011463aaf5 (diff)
Rustup to rustc 1.44.0-nightly (699f83f52 2020-03-29)
Diffstat (limited to 'src')
-rw-r--r--src/abi/comments.rs2
-rw-r--r--src/abi/mod.rs2
-rw-r--r--src/abi/pass_mode.rs2
-rw-r--r--src/abi/returning.rs4
-rw-r--r--src/common.rs4
-rw-r--r--src/constant.rs4
-rw-r--r--src/discriminant.rs2
-rw-r--r--src/intrinsics/mod.rs16
-rw-r--r--src/lib.rs2
-rw-r--r--src/trap.rs4
-rw-r--r--src/unsize.rs6
-rw-r--r--src/value_and_place.rs36
-rw-r--r--src/vtable.rs4
13 files changed, 44 insertions, 44 deletions
diff --git a/src/abi/comments.rs b/src/abi/comments.rs
index 4f5fb0f2e44..773b49f8e44 100644
--- a/src/abi/comments.rs
+++ b/src/abi/comments.rs
@@ -61,7 +61,7 @@ pub(super) fn add_local_place_comments<'tcx>(
     place: CPlace<'tcx>,
     local: Local,
 ) {
-    let TyLayout { ty, layout } = place.layout();
+    let TyAndLayout { ty, layout } = place.layout();
     let ty::layout::Layout {
         size,
         align,
diff --git a/src/abi/mod.rs b/src/abi/mod.rs
index 2e7a73a484d..eb03552bf0e 100644
--- a/src/abi/mod.rs
+++ b/src/abi/mod.rs
@@ -271,7 +271,7 @@ impl<'tcx, B: Backend + 'static> FunctionCx<'_, 'tcx, B> {
 fn local_place<'tcx>(
     fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
     local: Local,
-    layout: TyLayout<'tcx>,
+    layout: TyAndLayout<'tcx>,
     is_ssa: bool,
 ) -> CPlace<'tcx> {
     let place = if is_ssa {
diff --git a/src/abi/pass_mode.rs b/src/abi/pass_mode.rs
index bed4574717e..8ebc981d9b0 100644
--- a/src/abi/pass_mode.rs
+++ b/src/abi/pass_mode.rs
@@ -76,7 +76,7 @@ impl PassMode {
     }
 }
 
-pub(super) fn get_pass_mode<'tcx>(tcx: TyCtxt<'tcx>, layout: TyLayout<'tcx>) -> PassMode {
+pub(super) fn get_pass_mode<'tcx>(tcx: TyCtxt<'tcx>, layout: TyAndLayout<'tcx>) -> PassMode {
     if layout.is_zst() {
         // WARNING zst arguments must never be passed, as that will break CastKind::ClosureFnPointer
         PassMode::NoPass
diff --git a/src/abi/returning.rs b/src/abi/returning.rs
index 59836f881b6..d53abe32147 100644
--- a/src/abi/returning.rs
+++ b/src/abi/returning.rs
@@ -1,11 +1,11 @@
 use crate::abi::pass_mode::*;
 use crate::prelude::*;
 
-fn return_layout<'a, 'tcx>(fx: &mut FunctionCx<'a, 'tcx, impl Backend>) -> TyLayout<'tcx> {
+fn return_layout<'a, 'tcx>(fx: &mut FunctionCx<'a, 'tcx, impl Backend>) -> TyAndLayout<'tcx> {
     fx.layout_of(fx.monomorphize(&fx.mir.local_decls[RETURN_PLACE].ty))
 }
 
-pub(crate) fn can_return_to_ssa_var<'tcx>(tcx: TyCtxt<'tcx>, dest_layout: TyLayout<'tcx>) -> bool {
+pub(crate) fn can_return_to_ssa_var<'tcx>(tcx: TyCtxt<'tcx>, dest_layout: TyAndLayout<'tcx>) -> bool {
     match get_pass_mode(tcx, dest_layout) {
         PassMode::NoPass | PassMode::ByVal(_) => true,
         // FIXME Make it possible to return ByValPair and ByRef to an ssa var.
diff --git a/src/common.rs b/src/common.rs
index 09133d94db2..1d3fdfc75bf 100644
--- a/src/common.rs
+++ b/src/common.rs
@@ -282,9 +282,9 @@ pub(crate) struct FunctionCx<'clif, 'tcx, B: Backend + 'static> {
 
 impl<'tcx, B: Backend> LayoutOf for FunctionCx<'_, 'tcx, B> {
     type Ty = Ty<'tcx>;
-    type TyLayout = TyLayout<'tcx>;
+    type TyAndLayout = TyAndLayout<'tcx>;
 
-    fn layout_of(&self, ty: Ty<'tcx>) -> TyLayout<'tcx> {
+    fn layout_of(&self, ty: Ty<'tcx>) -> TyAndLayout<'tcx> {
         assert!(!ty.needs_subst());
         self.tcx
             .layout_of(ParamEnv::reveal_all().and(&ty))
diff --git a/src/constant.rs b/src/constant.rs
index 7bd2f476193..306f61aa074 100644
--- a/src/constant.rs
+++ b/src/constant.rs
@@ -46,7 +46,7 @@ pub(crate) fn codegen_static(constants_cx: &mut ConstantCx, def_id: DefId) {
 fn codegen_static_ref<'tcx>(
     fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
     def_id: DefId,
-    layout: TyLayout<'tcx>,
+    layout: TyAndLayout<'tcx>,
 ) -> CPlace<'tcx> {
     let linkage = crate::linkage::get_static_ref_linkage(fx.tcx, def_id);
     let data_id = data_id_for_static(fx.tcx, fx.module, def_id, linkage);
@@ -277,7 +277,7 @@ fn data_id_for_static(
 
 fn cplace_for_dataid<'tcx>(
     fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
-    layout: TyLayout<'tcx>,
+    layout: TyAndLayout<'tcx>,
     local_data_id: GlobalValue,
 ) -> CPlace<'tcx> {
     let global_ptr = fx.bcx.ins().global_value(fx.pointer_type, local_data_id);
diff --git a/src/discriminant.rs b/src/discriminant.rs
index a6d6d814fc9..2d0b36a5480 100644
--- a/src/discriminant.rs
+++ b/src/discriminant.rs
@@ -55,7 +55,7 @@ pub(crate) fn codegen_set_discriminant<'tcx>(
 pub(crate) fn codegen_get_discriminant<'tcx>(
     fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
     value: CValue<'tcx>,
-    dest_layout: TyLayout<'tcx>,
+    dest_layout: TyAndLayout<'tcx>,
 ) -> CValue<'tcx> {
     let layout = value.layout();
 
diff --git a/src/intrinsics/mod.rs b/src/intrinsics/mod.rs
index 2034d95cdac..feacb3e6e9e 100644
--- a/src/intrinsics/mod.rs
+++ b/src/intrinsics/mod.rs
@@ -140,8 +140,8 @@ macro atomic_minmax($fx:expr, $cc:expr, <$T:ident> ($ptr:ident, $src:ident) -> $
 
 fn lane_type_and_count<'tcx>(
     tcx: TyCtxt<'tcx>,
-    layout: TyLayout<'tcx>,
-) -> (TyLayout<'tcx>, u16) {
+    layout: TyAndLayout<'tcx>,
+) -> (TyAndLayout<'tcx>, u16) {
     assert!(layout.ty.is_simd());
     let lane_count = match layout.fields {
         layout::FieldPlacement::Array { stride: _, count } => u16::try_from(count).unwrap(),
@@ -154,7 +154,7 @@ fn lane_type_and_count<'tcx>(
     (lane_layout, lane_count)
 }
 
-fn clif_vector_type<'tcx>(tcx: TyCtxt<'tcx>, layout: TyLayout<'tcx>) -> Option<Type> {
+fn clif_vector_type<'tcx>(tcx: TyCtxt<'tcx>, layout: TyAndLayout<'tcx>) -> Option<Type> {
     let (element, count) = match &layout.abi {
         Abi::Vector { element, count } => (element.clone(), *count),
         _ => unreachable!(),
@@ -175,8 +175,8 @@ fn simd_for_each_lane<'tcx, B: Backend>(
     ret: CPlace<'tcx>,
     f: impl Fn(
         &mut FunctionCx<'_, 'tcx, B>,
-        TyLayout<'tcx>,
-        TyLayout<'tcx>,
+        TyAndLayout<'tcx>,
+        TyAndLayout<'tcx>,
         Value,
     ) -> CValue<'tcx>,
 ) {
@@ -203,8 +203,8 @@ fn simd_pair_for_each_lane<'tcx, B: Backend>(
     ret: CPlace<'tcx>,
     f: impl Fn(
         &mut FunctionCx<'_, 'tcx, B>,
-        TyLayout<'tcx>,
-        TyLayout<'tcx>,
+        TyAndLayout<'tcx>,
+        TyAndLayout<'tcx>,
         Value,
         Value,
     ) -> CValue<'tcx>,
@@ -229,7 +229,7 @@ fn simd_pair_for_each_lane<'tcx, B: Backend>(
 
 fn bool_to_zero_or_max_uint<'tcx>(
     fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
-    layout: TyLayout<'tcx>,
+    layout: TyAndLayout<'tcx>,
     val: Value,
 ) -> CValue<'tcx> {
     let ty = fx.clif_type(layout.ty).unwrap();
diff --git a/src/lib.rs b/src/lib.rs
index 303ef3f7f94..fb062071339 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -72,7 +72,7 @@ mod prelude {
     pub(crate) use rustc_hir::def_id::{DefId, LOCAL_CRATE};
     pub(crate) use rustc::mir::{self, *};
     pub(crate) use rustc_session::Session;
-    pub(crate) use rustc::ty::layout::{self, Abi, LayoutOf, Scalar, Size, TyLayout, VariantIdx};
+    pub(crate) use rustc::ty::layout::{self, Abi, LayoutOf, Scalar, Size, TyAndLayout, VariantIdx};
     pub(crate) use rustc::ty::{
         self, FnSig, Instance, InstanceDef, ParamEnv, Ty, TyCtxt, TypeAndMut, TypeFoldable,
     };
diff --git a/src/trap.rs b/src/trap.rs
index d63e86db29d..86af1ee5381 100644
--- a/src/trap.rs
+++ b/src/trap.rs
@@ -80,7 +80,7 @@ pub(crate) fn trap_unreachable(
 /// Trap code: user65535
 pub(crate) fn trap_unreachable_ret_value<'tcx>(
     fx: &mut FunctionCx<'_, 'tcx, impl cranelift_module::Backend>,
-    dest_layout: TyLayout<'tcx>,
+    dest_layout: TyAndLayout<'tcx>,
     msg: impl AsRef<str>,
 ) -> CValue<'tcx> {
     trap_unreachable(fx, msg);
@@ -106,7 +106,7 @@ pub(crate) fn trap_unimplemented(
 /// Trap code: user65535
 pub(crate) fn trap_unimplemented_ret_value<'tcx>(
     fx: &mut FunctionCx<'_, 'tcx, impl cranelift_module::Backend>,
-    dest_layout: TyLayout<'tcx>,
+    dest_layout: TyAndLayout<'tcx>,
     msg: impl AsRef<str>,
 ) -> CValue<'tcx> {
     trap_unimplemented(fx, msg);
diff --git a/src/unsize.rs b/src/unsize.rs
index d6a85deda78..affb36d7d37 100644
--- a/src/unsize.rs
+++ b/src/unsize.rs
@@ -43,8 +43,8 @@ pub(crate) fn unsized_info<'tcx>(
 fn unsize_thin_ptr<'tcx>(
     fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
     src: Value,
-    src_layout: TyLayout<'tcx>,
-    dst_layout: TyLayout<'tcx>,
+    src_layout: TyAndLayout<'tcx>,
+    dst_layout: TyAndLayout<'tcx>,
 ) -> (Value, Value) {
     match (&src_layout.ty.kind, &dst_layout.ty.kind) {
         (&ty::Ref(_, a, _), &ty::Ref(_, b, _))
@@ -139,7 +139,7 @@ pub(crate) fn coerce_unsized_into<'tcx>(
 
 pub(crate) fn size_and_align_of_dst<'tcx>(
     fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
-    layout: TyLayout<'tcx>,
+    layout: TyAndLayout<'tcx>,
     info: Value,
 ) -> (Value, Value) {
     if !layout.is_unsized() {
diff --git a/src/value_and_place.rs b/src/value_and_place.rs
index 41fe85795c2..226c78ed01c 100644
--- a/src/value_and_place.rs
+++ b/src/value_and_place.rs
@@ -6,9 +6,9 @@ fn codegen_field<'tcx>(
     fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
     base: Pointer,
     extra: Option<Value>,
-    layout: TyLayout<'tcx>,
+    layout: TyAndLayout<'tcx>,
     field: mir::Field,
-) -> (Pointer, TyLayout<'tcx>) {
+) -> (Pointer, TyAndLayout<'tcx>) {
     let field_offset = layout.fields.offset(field.index());
     let field_layout = layout.field(&*fx, field.index());
 
@@ -62,7 +62,7 @@ fn scalar_pair_calculate_b_offset(tcx: TyCtxt<'_>, a_scalar: &Scalar, b_scalar:
 
 /// A read-only value
 #[derive(Debug, Copy, Clone)]
-pub(crate) struct CValue<'tcx>(CValueInner, TyLayout<'tcx>);
+pub(crate) struct CValue<'tcx>(CValueInner, TyAndLayout<'tcx>);
 
 #[derive(Debug, Copy, Clone)]
 enum CValueInner {
@@ -72,23 +72,23 @@ enum CValueInner {
 }
 
 impl<'tcx> CValue<'tcx> {
-    pub(crate) fn by_ref(ptr: Pointer, layout: TyLayout<'tcx>) -> CValue<'tcx> {
+    pub(crate) fn by_ref(ptr: Pointer, layout: TyAndLayout<'tcx>) -> CValue<'tcx> {
         CValue(CValueInner::ByRef(ptr, None), layout)
     }
 
-    pub(crate) fn by_ref_unsized(ptr: Pointer, meta: Value, layout: TyLayout<'tcx>) -> CValue<'tcx> {
+    pub(crate) fn by_ref_unsized(ptr: Pointer, meta: Value, layout: TyAndLayout<'tcx>) -> CValue<'tcx> {
         CValue(CValueInner::ByRef(ptr, Some(meta)), layout)
     }
 
-    pub(crate) fn by_val(value: Value, layout: TyLayout<'tcx>) -> CValue<'tcx> {
+    pub(crate) fn by_val(value: Value, layout: TyAndLayout<'tcx>) -> CValue<'tcx> {
         CValue(CValueInner::ByVal(value), layout)
     }
 
-    pub(crate) fn by_val_pair(value: Value, extra: Value, layout: TyLayout<'tcx>) -> CValue<'tcx> {
+    pub(crate) fn by_val_pair(value: Value, extra: Value, layout: TyAndLayout<'tcx>) -> CValue<'tcx> {
         CValue(CValueInner::ByValPair(value, extra), layout)
     }
 
-    pub(crate) fn layout(&self) -> TyLayout<'tcx> {
+    pub(crate) fn layout(&self) -> TyAndLayout<'tcx> {
         self.1
     }
 
@@ -194,7 +194,7 @@ impl<'tcx> CValue<'tcx> {
     /// If `ty` is signed, `const_val` must already be sign extended.
     pub(crate) fn const_val(
         fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
-        layout: TyLayout<'tcx>,
+        layout: TyAndLayout<'tcx>,
         const_val: u128,
     ) -> CValue<'tcx> {
         use cranelift_codegen::ir::immediates::{Ieee32, Ieee64};
@@ -243,7 +243,7 @@ impl<'tcx> CValue<'tcx> {
         CValue::by_val(val, layout)
     }
 
-    pub(crate) fn unchecked_cast_to(self, layout: TyLayout<'tcx>) -> Self {
+    pub(crate) fn unchecked_cast_to(self, layout: TyAndLayout<'tcx>) -> Self {
         CValue(self.0, layout)
     }
 }
@@ -252,7 +252,7 @@ impl<'tcx> CValue<'tcx> {
 #[derive(Debug, Copy, Clone)]
 pub(crate) struct CPlace<'tcx> {
     inner: CPlaceInner,
-    layout: TyLayout<'tcx>,
+    layout: TyAndLayout<'tcx>,
 }
 
 #[derive(Debug, Copy, Clone)]
@@ -263,7 +263,7 @@ pub(crate) enum CPlaceInner {
 }
 
 impl<'tcx> CPlace<'tcx> {
-    pub(crate) fn layout(&self) -> TyLayout<'tcx> {
+    pub(crate) fn layout(&self) -> TyAndLayout<'tcx> {
         self.layout
     }
 
@@ -271,7 +271,7 @@ impl<'tcx> CPlace<'tcx> {
         &self.inner
     }
 
-    pub(crate) fn no_place(layout: TyLayout<'tcx>) -> CPlace<'tcx> {
+    pub(crate) fn no_place(layout: TyAndLayout<'tcx>) -> CPlace<'tcx> {
         CPlace {
             inner: CPlaceInner::NoPlace,
             layout,
@@ -280,7 +280,7 @@ impl<'tcx> CPlace<'tcx> {
 
     pub(crate) fn new_stack_slot(
         fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
-        layout: TyLayout<'tcx>,
+        layout: TyAndLayout<'tcx>,
     ) -> CPlace<'tcx> {
         assert!(!layout.is_unsized());
         if layout.size.bytes() == 0 {
@@ -304,7 +304,7 @@ impl<'tcx> CPlace<'tcx> {
     pub(crate) fn new_var(
         fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
         local: Local,
-        layout: TyLayout<'tcx>,
+        layout: TyAndLayout<'tcx>,
     ) -> CPlace<'tcx> {
         fx.bcx
             .declare_var(mir_var(local), fx.clif_type(layout.ty).unwrap());
@@ -314,14 +314,14 @@ impl<'tcx> CPlace<'tcx> {
         }
     }
 
-    pub(crate) fn for_ptr(ptr: Pointer, layout: TyLayout<'tcx>) -> CPlace<'tcx> {
+    pub(crate) fn for_ptr(ptr: Pointer, layout: TyAndLayout<'tcx>) -> CPlace<'tcx> {
         CPlace {
             inner: CPlaceInner::Addr(ptr, None),
             layout,
         }
     }
 
-    pub(crate) fn for_ptr_with_extra(ptr: Pointer, extra: Value, layout: TyLayout<'tcx>) -> CPlace<'tcx> {
+    pub(crate) fn for_ptr_with_extra(ptr: Pointer, extra: Value, layout: TyAndLayout<'tcx>) -> CPlace<'tcx> {
         CPlace {
             inner: CPlaceInner::Addr(ptr, Some(extra)),
             layout,
@@ -578,7 +578,7 @@ impl<'tcx> CPlace<'tcx> {
         }
     }
 
-    pub(crate) fn unchecked_cast_to(self, layout: TyLayout<'tcx>) -> Self {
+    pub(crate) fn unchecked_cast_to(self, layout: TyAndLayout<'tcx>) -> Self {
         assert!(!self.layout().is_unsized());
         match self.inner {
             CPlaceInner::NoPlace => {
diff --git a/src/vtable.rs b/src/vtable.rs
index 127e4ce79a6..436073d26ce 100644
--- a/src/vtable.rs
+++ b/src/vtable.rs
@@ -69,7 +69,7 @@ pub(crate) fn get_ptr_and_method_ref<'tcx>(
 
 pub(crate) fn get_vtable<'tcx>(
     fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
-    layout: TyLayout<'tcx>,
+    layout: TyAndLayout<'tcx>,
     trait_ref: Option<ty::PolyExistentialTraitRef<'tcx>>,
 ) -> Value {
     let data_id = if let Some(data_id) = fx.vtables.get(&(layout.ty, trait_ref)) {
@@ -86,7 +86,7 @@ pub(crate) fn get_vtable<'tcx>(
 
 fn build_vtable<'tcx>(
     fx: &mut FunctionCx<'_, 'tcx, impl Backend>,
-    layout: TyLayout<'tcx>,
+    layout: TyAndLayout<'tcx>,
     trait_ref: Option<ty::PolyExistentialTraitRef<'tcx>>,
 ) -> DataId {
     let tcx = fx.tcx;