We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 18ec4a9 commit a65c050Copy full SHA for a65c050
compiler/rustc_mir/src/transform/inline.rs
@@ -382,7 +382,7 @@ impl Inliner<'tcx> {
382
// Cost of the var is the size in machine-words, if we know
383
// it.
384
if let Some(size) = type_size_of(tcx, self.param_env, ty) {
385
- cost += (size / ptr_size) as usize;
+ cost += ((size + ptr_size - 1) / ptr_size) as usize;
386
} else {
387
cost += UNKNOWN_SIZE_COST;
388
}
0 commit comments