about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src/vec_cache.rs
diff options
context:
space:
mode:
authorThe rustc-josh-sync Cronjob Bot <github-actions@github.com>2025-07-17 04:14:33 +0000
committerThe rustc-josh-sync Cronjob Bot <github-actions@github.com>2025-07-17 04:14:33 +0000
commitce0de761f333204d931d2d43a96468986f51ebbd (patch)
tree5e7f3165b5beac3fe72f520dbb94be30b73101bb /compiler/rustc_data_structures/src/vec_cache.rs
parent2faf5ed0cd20debd5eb6efe1795badccf6390c60 (diff)
parentfd2eb391d032181459773f3498c17b198513e0d0 (diff)
downloadrust-ce0de761f333204d931d2d43a96468986f51ebbd.tar.gz
rust-ce0de761f333204d931d2d43a96468986f51ebbd.zip
Merge ref 'fd2eb391d032' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: fd2eb391d032181459773f3498c17b198513e0d0
Filtered ref: 1ea8d5f9c22f0930a0caa27637ef9232fead3c2b

This merge was created using https://github.com/rust-lang/josh-sync.
Diffstat (limited to 'compiler/rustc_data_structures/src/vec_cache.rs')
-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,