Skip to content

Commit

Permalink
fixed unsafe block
Browse files Browse the repository at this point in the history
  • Loading branch information
Billy-Sheppard committed May 12, 2024
1 parent f453fab commit 6eb6aee
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions library/alloc/src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3308,8 +3308,10 @@ impl Default for Arc<str> {
fn default() -> Self {
let arc: Arc<[u8]> = Default::default();
debug_assert!(core::str::from_utf8(&*arc).is_ok());
let (ptr, alloc) = Arc::internal_into_inner_with_allocator(arc);
unsafe { Arc::from_ptr_in(ptr.as_ptr() as *mut ArcInner<str>, alloc) }
unsafe {
let (ptr, alloc) = Arc::internal_into_inner_with_allocator(arc);
Arc::from_ptr_in(ptr.as_ptr() as *mut ArcInner<str>, alloc)
}
}
}

Expand Down

0 comments on commit 6eb6aee

Please sign in to comment.