about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-07-04 22:36:39 +0000
committerbors <bors@rust-lang.org>2025-07-04 22:36:39 +0000
commitd98a5da813da67eb189387b8ccfb73cf481275d8 (patch)
treeeed8e7a7980453b05c75a153eb21a3a7e23bb839 /compiler/rustc_data_structures/src
parente3843659e9f65f589d184d1221ac6149d5fa07b5 (diff)
parent1ff6e4478529ed4bf096476cd68b877099fc09f0 (diff)
downloadrust-d98a5da813da67eb189387b8ccfb73cf481275d8.tar.gz
rust-d98a5da813da67eb189387b8ccfb73cf481275d8.zip
Auto merge of #143459 - matthiaskrgr:rollup-gsv6uzl, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#141532 (std: sys: net: uefi: tcp4: Implement write)
 - rust-lang/rust#143085 (Port `#[non_exhaustive]` to the new attribute parsing infrastructure)
 - rust-lang/rust#143372 (Remove names_imported_by_glob_use query.)
 - rust-lang/rust#143386 (Assign dependency bump PRs to me)
 - rust-lang/rust#143406 (Remove some unnecessary `unsafe` in VecCache)
 - rust-lang/rust#143408 (mbe: Gracefully handle macro rules that end after `=>`)
 - rust-lang/rust#143414 (remove special-casing of boxes from match exhaustiveness/usefulness analysis)
 - rust-lang/rust#143444 (clean up GVN TypeId test)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_data_structures/src')
-rw-r--r--compiler/rustc_data_structures/src/vec_cache.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_data_structures/src/vec_cache.rs b/compiler/rustc_data_structures/src/vec_cache.rs
index 0ffa6b3205f..599970663db 100644
--- a/compiler/rustc_data_structures/src/vec_cache.rs
+++ b/compiler/rustc_data_structures/src/vec_cache.rs
@@ -76,8 +76,8 @@ impl SlotIndex {
                 index_in_bucket: idx as usize,
             };
         }
-        // SAFETY: We already ruled out idx 0, so `checked_ilog2` can't return `None`.
-        let bucket = unsafe { idx.checked_ilog2().unwrap_unchecked() as usize };
+        // We already ruled out idx 0, so this `ilog2` never panics (and the check optimizes away)
+        let bucket = idx.ilog2() as usize;
         let entries = 1 << bucket;
         SlotIndex {
             bucket_idx: bucket - FIRST_BUCKET_SHIFT + 1,