Index: rustc-1.28.0-src/src/liballoc/slice.rs =================================================================== --- rustc-1.28.0-src/src/liballoc/slice.rs +++ rustc-1.28.0-src/src/liballoc/slice.rs 2018-09-27 13:56:39.086468770 +0200 @@ -417,7 +417,7 @@ // and `rem` is the remaining part of `n`. // Using `Vec` to access `set_len()`. - let mut buf = Vec::with_capacity(self.len() * n); + let mut buf = Vec::with_capacity(self.len().checked_mul(n).expect("capacity overflow")); // `2^expn` repetition is done by doubling `buf` `expn`-times. buf.extend(self);