Skip to content

Commit c9b3df6

Browse files
committed
Tidy
1 parent c268ba6 commit c9b3df6

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

+5-2
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,10 @@ pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
231231
if layout.size.bytes() >= MIN_DANGEROUS_SIZE {
232232
let size_str = || {
233233
let (size_quantity, size_unit) = human_readable_bytes(layout.size.bytes());
234-
format!("Dangerous stack allocation of size: {:.2} {} exceeds limits on most architectures", size_quantity, size_unit)
234+
format!(
235+
"Dangerous stack allocation of size: {:.2} {} exceeds limits on most architectures",
236+
size_quantity, size_unit
237+
)
235238
};
236239
cx.tcx().dcx().fatal(size_str());
237240
}
@@ -281,7 +284,7 @@ pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
281284
//
282285
// Taken from Cargo:
283286
// https://github.com/rust-lang/cargo/blob/2ce45605d9db521b5fd6c1211ce8de6055fdb24e/src/cargo/util/mod.rs#L88-L95
284-
pub fn human_readable_bytes(bytes: u64) -> (f32, &'static str) {
287+
pub fn human_readable_bytes(bytes: u64) -> (u32, &'static str) {
285288
static UNITS: [&str; 7] = ["B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB"];
286289
let bytes = bytes as f32;
287290
let i = ((bytes.log2() / 10.0) as usize).min(UNITS.len() - 1);

0 commit comments

Comments
 (0)