Skip to content

Commit 3bbc598

Browse files
committed
use bug! for overflow of u128
1 parent b133841 commit 3bbc598

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/rustc_hir_typeck/src/intrinsicck.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
8787
if let Some(v) = u128::from(size.bytes()).checked_mul(8) {
8888
format!("{} bits", v)
8989
} else {
90-
format!("{} bytes", size.bytes())
90+
// `u128` should definitely be able to hold the size of different architectures
91+
// larger sizes should be reported as error `are too big for the current architecture`
92+
// otherwise we have a bug somewhere
93+
bug!("{:?} overflow for u128", size)
9194
}
9295
}
9396
Ok(SizeSkeleton::Generic(size)) => {

0 commit comments

Comments
 (0)