X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_middle%2Fsrc%2Fmir%2Ftcx.rs;h=b48e8a868efdb1cf01a0b9e9abf5cf93fbbad603;hb=1c3409f333eb059aeb89a78a01a3a48dc8a52680;hp=6e8191459769829af787e8ba4324832168c314da;hpb=ef2ef926a53baaa9d7a1b73b516d399af7e9aedb;p=rust.git diff --git a/compiler/rustc_middle/src/mir/tcx.rs b/compiler/rustc_middle/src/mir/tcx.rs index 6e819145976..b48e8a868ef 100644 --- a/compiler/rustc_middle/src/mir/tcx.rs +++ b/compiler/rustc_middle/src/mir/tcx.rs @@ -196,7 +196,7 @@ pub fn ty(&self, local_decls: &D, tcx: TyCtxt<'tcx>) -> Ty<'tcx> Rvalue::UnaryOp(UnOp::Not | UnOp::Neg, ref operand) => operand.ty(local_decls, tcx), Rvalue::Discriminant(ref place) => place.ty(local_decls, tcx).ty.discriminant_ty(tcx), Rvalue::NullaryOp(NullOp::Box, t) => tcx.mk_box(t), - Rvalue::NullaryOp(NullOp::SizeOf, _) => tcx.types.usize, + Rvalue::NullaryOp(NullOp::SizeOf | NullOp::AlignOf, _) => tcx.types.usize, Rvalue::Aggregate(ref ak, ref ops) => match **ak { AggregateKind::Array(ty) => tcx.mk_array(ty, ops.len() as u64), AggregateKind::Tuple => tcx.mk_tup(ops.iter().map(|op| op.ty(local_decls, tcx))), @@ -265,7 +265,7 @@ pub fn to_mutbl_lossy(self) -> hir::Mutability { BorrowKind::Shared => hir::Mutability::Not, // We have no type corresponding to a unique imm borrow, so - // use `&mut`. It gives all the capabilities of an `&uniq` + // use `&mut`. It gives all the capabilities of a `&uniq` // and hence is a safe "over approximation". BorrowKind::Unique => hir::Mutability::Mut,