X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc%2Fty%2Fsty.rs;h=ddc4bd3f9f6c3c057cd918147a6eef1937be875e;hb=247e0a688ddd4c7d8d45f1be5d159d5e0d9dde2c;hp=a2b2fc7a4451a23eba0d5e6bffc3c2e039e5c671;hpb=b4a3d44a873302d89873e89b825204ae20cbcc09;p=rust.git diff --git a/src/librustc/ty/sty.rs b/src/librustc/ty/sty.rs index a2b2fc7a445..ddc4bd3f9f6 100644 --- a/src/librustc/ty/sty.rs +++ b/src/librustc/ty/sty.rs @@ -3,7 +3,7 @@ use crate::hir; use crate::hir::def_id::DefId; use crate::infer::canonical::Canonical; -use crate::mir::interpret::{ConstValue, truncate}; +use crate::mir::interpret::ConstValue; use crate::middle::region; use polonius_engine::Atom; use rustc_data_structures::indexed_vec::Idx; @@ -56,9 +56,6 @@ pub enum BoundRegion { /// the event of shadowing. BrNamed(DefId, InternedString), - /// Fresh bound identifiers created during GLB computations. - BrFresh(u32), - /// Anonymous region for the implicit env pointer parameter /// to a closure BrEnv, @@ -998,7 +995,7 @@ pub fn from_ref_and_name( tcx: TyCtxt<'_, '_, '_>, trait_ref: ty::TraitRef<'tcx>, item_name: Ident ) -> ProjectionTy<'tcx> { let item_def_id = tcx.associated_items(trait_ref.def_id).find(|item| { - item.kind == ty::AssociatedKind::Type && + item.kind == ty::AssocKind::Type && tcx.hygienic_eq(item_name, item.ident, trait_ref.def_id) }).unwrap().def_id; @@ -2232,14 +2229,12 @@ pub fn from_bits( let size = tcx.layout_of(ty).unwrap_or_else(|e| { panic!("could not compute layout for {:?}: {:?}", ty, e) }).size; - let truncated = truncate(bits, size); - assert_eq!(truncated, bits, "from_bits called with untruncated value"); - Self::from_scalar(tcx, Scalar::Bits { bits, size: size.bytes() as u8 }, ty.value) + Self::from_scalar(tcx, Scalar::from_uint(bits, size), ty.value) } #[inline] pub fn zero_sized(tcx: TyCtxt<'_, '_, 'tcx>, ty: Ty<'tcx>) -> &'tcx Self { - Self::from_scalar(tcx, Scalar::Bits { bits: 0, size: 0 }, ty) + Self::from_scalar(tcx, Scalar::zst(), ty) } #[inline]