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
This commit is contained in:
commit
e35a56d96f
17 changed files with 32 additions and 22 deletions
|
@ -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())))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue