diff --git a/compiler/rustc_hir_typeck/src/intrinsicck.rs b/compiler/rustc_hir_typeck/src/intrinsicck.rs index e1837eb55826..362c07431e0a 100644 --- a/compiler/rustc_hir_typeck/src/intrinsicck.rs +++ b/compiler/rustc_hir_typeck/src/intrinsicck.rs @@ -87,7 +87,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { if let Some(v) = u128::from(size.bytes()).checked_mul(8) { format!("{} bits", v) } else { - format!("{} bytes", size.bytes()) + // `u128` should definitely be able to hold the size of different architectures + // larger sizes should be reported as error `are too big for the current architecture` + // otherwise we have a bug somewhere + bug!("{:?} overflow for u128", size) } } Ok(SizeSkeleton::Generic(size)) => {