Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions crates/oxc_allocator/src/vec2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1171,9 +1171,7 @@ impl<'bump, T: 'bump> Vec<'bump, T> {
#[inline]
#[expect(clippy::cast_possible_truncation)]
pub unsafe fn set_len(&mut self, new_len: usize) {
// `new_len as u32` is safe because caller must ensure that
// `new_len` is less than or equal to `u32::MAX`, otherwise
// it is UB.
// Caller guarantees `new_len <= u32::MAX`, so `new_len as u32` cannot truncate `new_len`
self.buf.len = new_len as u32;
}

Expand Down
Loading