X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_const_eval%2Fsrc%2Finterpret%2Foperand.rs;h=f0a83b7a02689d4607e545b325e8a0ae803878e3;hb=1a6ed3050ff0ba96d0fa4e91fd657fe983623330;hp=0c212cf59e17fe1d5b2e26eccd8fa04699289a8c;hpb=2f02cf8768bff3e32a2bfaa42294cb5dd6abd58b;p=rust.git diff --git a/compiler/rustc_const_eval/src/interpret/operand.rs b/compiler/rustc_const_eval/src/interpret/operand.rs index 0c212cf59e1..f0a83b7a026 100644 --- a/compiler/rustc_const_eval/src/interpret/operand.rs +++ b/compiler/rustc_const_eval/src/interpret/operand.rs @@ -4,7 +4,7 @@ use rustc_hir::def::Namespace; use rustc_middle::ty::layout::{LayoutOf, PrimitiveExt, TyAndLayout}; use rustc_middle::ty::print::{FmtPrinter, PrettyPrinter}; -use rustc_middle::ty::{ConstInt, DelaySpanBugEmitted, Ty}; +use rustc_middle::ty::{ConstInt, Ty}; use rustc_middle::{mir, ty}; use rustc_target::abi::{self, Abi, Align, HasDataLayout, Size, TagEncoding}; use rustc_target::abi::{VariantIdx, Variants}; @@ -280,7 +280,7 @@ pub fn offset( layout: TyAndLayout<'tcx>, cx: &impl HasDataLayout, ) -> InterpResult<'tcx, Self> { - assert!(!layout.is_unsized()); + assert!(layout.is_sized()); self.offset_with_meta(offset, MemPlaceMeta::None, layout, cx) } } @@ -376,7 +376,7 @@ pub fn read_immediate_raw( /// Read an immediate from a place, asserting that that is possible with the given layout. /// - /// If this suceeds, the `ImmTy` is never `Uninit`. + /// If this succeeds, the `ImmTy` is never `Uninit`. #[inline(always)] pub fn read_immediate( &self, @@ -567,7 +567,7 @@ pub fn const_to_op( ty::ConstKind::Param(_) | ty::ConstKind::Placeholder(..) => { throw_inval!(TooGeneric) } - ty::ConstKind::Error(DelaySpanBugEmitted { reported, .. }) => { + ty::ConstKind::Error(reported) => { throw_inval!(AlreadyReported(reported)) } ty::ConstKind::Unevaluated(uv) => {