-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove sized requirement from Arc::from_raw
`ptr.byte_sub` is stable since 1.75.0. The tricky part here is figuring out offset of `ArcInner.data` for DST. This PR assumes that raw pointer is coming from existing `Arc` so it is safe to convert to reference. I'm not 100% sure this is always correct. Correct version would require `Layout::for_value_raw` (or `mem::align_of_val_raw`) which is not stable. This can be used to convert `Arc<String>` to `Arc<dyn Debug>`.
- Loading branch information
1 parent
221076c
commit 4a8cbe7
Showing
2 changed files
with
64 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters