Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion turbopack/crates/turbo-rcstr/src/dynamic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ pub(crate) fn new_static_atom(string: &'static PrehashedString) -> RcStr {
// Tag it as a static pointer
entry = ((entry as usize) | STATIC_TAG as usize) as *mut PrehashedString;
let ptr: NonNull<PrehashedString> = unsafe {
// Safety: Box::into_raw returns a non-null pointer
// Safety: references always return a non-null pointers
NonNull::new_unchecked(entry as *mut _)
};

Expand Down
4 changes: 2 additions & 2 deletions turbopack/crates/turbo-rcstr/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,10 @@ impl Hash for RcStr {
PREHASHED_STRING_LOCATION => {
let l = unsafe { deref_from(self.unsafe_data) };
state.write_u64(l.hash);
state.write_u8(0xff);
state.write_u8(0xff); // matches the implementation of the `str` Hash impl
}
INLINE_LOCATION => {
self.as_str().hash(state);
self.inline_as_str().hash(state);
}
_ => unsafe { debug_unreachable!() },
}
Expand Down
Loading