You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tracking Issue for const checked slice to str conversions #91006
Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!
See this document for info about what commands tagged team members can give me.
Could we also get std::ffi::CStr::to_str covered by this issue?
I was hoping this would give me a safe compile-time way to construct str from CStr but currently std::ffi::CStr::to_bytes is not const (for whatever reason) so std::str::from_utf8(cstr_value.to_bytes()) cannot be done in const context.
Alternatively, making std::ffi::CStr::to_bytes const would also work for me.
Activity
Amanieu commentedon May 23, 2022
@rfcbot merge
rfcbot commentedon May 23, 2022
Team member @Amanieu has proposed to merge this. The next step is review by the rest of the tagged team members:
No concerns currently listed.
Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!
See this document for info about what commands tagged team members can give me.
WaffleLapkin commentedon May 23, 2022
Note that
from_utf8_mutis not being stabilized as&mutis still unstable inconstcontext.cc @oli-obk
Amanieu commentedon May 23, 2022
Tracking issue for
&mutinconst: #57349rfcbot commentedon Jun 8, 2022
🔔 This is now entering its final comment period, as per the review above. 🔔
rfcbot commentedon Jun 18, 2022
The final comment period, with a disposition to merge, as per the review above, is now complete.
As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.
This will be merged soon.
1 remaining item
mina86 commentedon Aug 8, 2022
Could we also get std::ffi::CStr::to_str covered by this issue?
I was hoping this would give me a safe compile-time way to construct str from CStr but currently std::ffi::CStr::to_bytes is not const (for whatever reason) so
std::str::from_utf8(cstr_value.to_bytes())cannot be done in const context.Alternatively, making std::ffi::CStr::to_bytes const would also work for me.
Auto merge of #97367 - WaffleLapkin:stabilize_checked_slice_to_str_co…
jhpratt commentedon Feb 5, 2025
As pointed out in #136517, there shouldn't be any blockers to stabilizing the mutable version of this.
@rustbot label +I-libs-api-nominated
Rollup merge of rust-lang#136668 - WaffleLapkin:from_utf8_mut, r=Amanieu
Unrolled build for rust-lang#136668
Rollup merge of rust-lang#136668 - WaffleLapkin:from_utf8_mut, r=Amanieu
Rollup merge of rust-lang#136668 - WaffleLapkin:from_utf8_mut, r=Amanieu
Auto merge of #97367 - WaffleLapkin:stabilize_checked_slice_to_str_co…
maxdexh commentedon Oct 21, 2026
This tracking issue is not mentioned in any stability attrs anymore and the methods have all been const stable for a while.