about summary refs log tree commit diff
path: root/library/alloc/src/rc.rs
diff options
context:
space:
mode:
authorjoboet <jonasboettiger@icloud.com>2024-01-13 20:10:00 +0100
committerjoboet <jonasboettiger@icloud.com>2024-01-13 20:10:00 +0100
commitfa9a911a57eff5d2cd59eacbffb4e41bc721db2e (patch)
treebe7dbf9dcc0c9d7639d68111762adbd962e6ee11 /library/alloc/src/rc.rs
parent174e73a3f6df6f96ab453493796e461164dea94a (diff)
downloadrust-fa9a911a57eff5d2cd59eacbffb4e41bc721db2e.tar.gz
rust-fa9a911a57eff5d2cd59eacbffb4e41bc721db2e.zip
libs: use `assert_unchecked` instead of intrinsic
Diffstat (limited to 'library/alloc/src/rc.rs')
-rw-r--r--library/alloc/src/rc.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs
index 263b1449de1..1eab681e956 100644
--- a/library/alloc/src/rc.rs
+++ b/library/alloc/src/rc.rs
@@ -252,6 +252,7 @@ use core::cell::Cell;
 use core::cmp::Ordering;
 use core::fmt;
 use core::hash::{Hash, Hasher};
+use core::hint;
 use core::intrinsics::abort;
 #[cfg(not(no_global_oom_handling))]
 use core::iter;
@@ -3268,7 +3269,7 @@ trait RcInnerPtr {
         // SAFETY: The reference count will never be zero when this is
         // called.
         unsafe {
-            core::intrinsics::assume(strong != 0);
+            hint::assert_unchecked(strong != 0);
         }
 
         let strong = strong.wrapping_add(1);
@@ -3301,7 +3302,7 @@ trait RcInnerPtr {
         // SAFETY: The reference count will never be zero when this is
         // called.
         unsafe {
-            core::intrinsics::assume(weak != 0);
+            hint::assert_unchecked(weak != 0);
         }
 
         let weak = weak.wrapping_add(1);