]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #98078 - erikdesjardins:uncheckedsize, r=petrochenkov
authorYuki Okushi <jtitor@2k36.org>
Wed, 15 Jun 2022 03:02:03 +0000 (12:02 +0900)
committerGitHub <noreply@github.com>
Wed, 15 Jun 2022 03:02:03 +0000 (12:02 +0900)
Use unchecked mul to compute slice sizes

This allows LLVM to realize that `slice.len() > 0` iff `slice.len() * size_of::<T>() > 0`, allowing a branch on the latter to be folded into the former when dropping vecs and boxed slices, in some cases.

Fixes (partially) #96497


Trivial merge