Skip to content

libs: Add {Arc,Rc}::{from,into}_inner_raw, use them in std::thread internals#233

Merged
RyanGlScott merged 1 commit intomasterfrom
T224-from_into_inner_raw
Feb 2, 2026
Merged

libs: Add {Arc,Rc}::{from,into}_inner_raw, use them in std::thread internals#233
RyanGlScott merged 1 commit intomasterfrom
T224-from_into_inner_raw

Conversation

@RyanGlScott
Copy link
Contributor

Fixes #224.

/// replacement for [`from_raw`] (to be used in conjunction with
/// [`into_inner_raw`]) that is feasible for `crucible-mir` to simulate.
#[inline]
#[stable(feature = "rc_raw", since = "1.17.0")]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I co-opted the same feature (rc_raw) used for {from,into}_raw for these new API functions, as well as for the {Arc,Rc}Inner types. I'm not sure if that's the best way to do this, however.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose (actual or intended) of adding this attribute ourselves?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The alloc crate is configured to require publicly-exported entities to be guarded behind some kind of stability attribute. If I try building the crate without this attribute, I run into the following error:

error: associated function has missing stability attribute
    --> ./libs/alloc/src/rc.rs:1332:5
     |
1332 |     pub unsafe fn from_inner_raw(ptr: *const RcInner<T>) -> Self {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 1 previous error

@RyanGlScott RyanGlScott added the standard libraries Issues involving mir-json's modified versions of the Rust standard libraries label Jan 26, 2026
@RyanGlScott RyanGlScott force-pushed the T224-from_into_inner_raw branch 2 times, most recently from f5db39d to 09db162 Compare January 30, 2026 13:41
@RyanGlScott RyanGlScott force-pushed the T224-from_into_inner_raw branch from 09db162 to b8178e9 Compare February 2, 2026 18:26
@RyanGlScott RyanGlScott merged commit 6a8ecc7 into master Feb 2, 2026
5 checks passed
@RyanGlScott RyanGlScott deleted the T224-from_into_inner_raw branch February 2, 2026 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

standard libraries Issues involving mir-json's modified versions of the Rust standard libraries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

libs: Offer Crucible-friendly alternatives to {Arc,Rc}::from_raw

3 participants