diff options
| author | bors <bors@rust-lang.org> | 2024-01-23 06:45:58 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-01-23 06:45:58 +0000 |
| commit | e35a56d96f7d9d4422f2b7b00bf0bf282b2ec782 (patch) | |
| tree | dae003e9517d57f7f1029a94bf136b1b21cc877f /library/alloc/src/vec/mod.rs | |
| parent | 0011fac90d2846ea3c04506238ff6e4ed3ce0efe (diff) | |
| parent | 638439a4404d9ef2da4027585134487875787e1d (diff) | |
| download | rust-e35a56d96f7d9d4422f2b7b00bf0bf282b2ec782.tar.gz rust-e35a56d96f7d9d4422f2b7b00bf0bf282b2ec782.zip | |
Auto merge of #119892 - joboet:libs_use_assert_unchecked, r=Nilstrieb,cuviper
Use `assert_unchecked` instead of `assume` intrinsic in the standard library Now that a public wrapper for the `assume` intrinsic exists, we can use it in the standard library. CC #119131
Diffstat (limited to 'library/alloc/src/vec/mod.rs')
| -rw-r--r-- | library/alloc/src/vec/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index c82e023fae1..6ca0dca1e9d 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -1996,7 +1996,7 @@ impl<T, A: Allocator> Vec<T, A> { } else { unsafe { self.len -= 1; - core::intrinsics::assume(self.len < self.capacity()); + core::hint::assert_unchecked(self.len < self.capacity()); Some(ptr::read(self.as_ptr().add(self.len()))) } } |
