Skip to content

Commit 2bfc2c4

Browse files
committed
Tidy
1 parent 8d81dee commit 2bfc2c4

File tree

1 file changed

+5
-2
lines changed
  • compiler/rustc_codegen_ssa/src/mir

1 file changed

+5
-2
lines changed

compiler/rustc_codegen_ssa/src/mir/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,10 @@ pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
232232
if layout.size.bytes() >= MIN_DANGEROUS_SIZE {
233233
let size_str = || {
234234
let (size_quantity, size_unit) = human_readable_bytes(layout.size.bytes());
235-
format!("Dangerous stack allocation of size: {:.2} {} exceeds limits on most architectures", size_quantity, size_unit)
235+
format!(
236+
"Dangerous stack allocation of size: {:.2} {} exceeds limits on most architectures",
237+
size_quantity, size_unit
238+
)
236239
};
237240
cx.tcx().dcx().fatal(size_str());
238241
}
@@ -291,7 +294,7 @@ pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
291294
//
292295
// Taken from Cargo:
293296
// https://github.com/rust-lang/cargo/blob/2ce45605d9db521b5fd6c1211ce8de6055fdb24e/src/cargo/util/mod.rs#L88-L95
294-
pub fn human_readable_bytes(bytes: u64) -> (f32, &'static str) {
297+
pub fn human_readable_bytes(bytes: u64) -> (u32, &'static str) {
295298
static UNITS: [&str; 7] = ["B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB"];
296299
let bytes = bytes as f32;
297300
let i = ((bytes.log2() / 10.0) as usize).min(UNITS.len() - 1);

0 commit comments

Comments
 (0)