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
This is a tracking issue for CStr methods as const functions.
Public API
// core::ffiimplCStr{// feature(const_cstr_methods)pubconstfnfrom_bytes_with_nul(bytes:&[u8]) -> Result<&Self,FromBytesWithNulError>;pubconstfnto_bytes(&self) -> &[u8];pubconstfnto_bytes_with_nul(&self) -> &[u8];pubconstfnto_str(&self) -> Result<&str, str::Utf8Error>;}// Note that those methods are stable, they are only unstable as `const` fn
@WaffleLapkin are any of these uncontroversial enough that you'd be comfortable const stabilizing them?
For #107429 I had to mark some of the memchr functions const stable, and the methods here largely have the same const dependencies. So, at least a subset of these could probably go const stable in the same release.
@tgross35 I personally think that all of these are uncontroversial and I'd be very comfortable stabilizing them, however I do not posses the power to do so. Stabilizing library APIs is a prerogative of T-libs-api.
Rightieo, I just was wondering if you had any bad feeling that any of them would be unmaintainable as const.
I think the FCP could take place on the PR since this is quite small, similarly to #107429. Would you like to make the stabilization PR? If not, I don't mind doing it tomorrow. (in either case, using my commit 877e9f5 as a base is likely a good idea to avoid a smidge of rebasing once #107429 is in)
@WaffleLapkin I think you can close this tracking issue if you would like, since #107624 merged. CStr::from_ptr was under this gate (I don't see it in this description) but moved to const_cstr_from_ptr with the merge, and I opened a new issue to track that #113219
Activity
Rollup merge of rust-lang#102961 - reitermarkus:const-cstr-from-ptr, …
Rollup merge of rust-lang#102961 - reitermarkus:const-cstr-from-ptr, …
Rollup merge of rust-lang#102961 - reitermarkus:const-cstr-from-ptr, …
Rollup merge of rust-lang#102961 - reitermarkus:const-cstr-from-ptr, …
tgross35 commentedon Feb 1, 2023
@WaffleLapkin are any of these uncontroversial enough that you'd be comfortable const stabilizing them?
For #107429 I had to mark some of the memchr functions const stable, and the methods here largely have the same const dependencies. So, at least a subset of these could probably go const stable in the same release.
WaffleLapkin commentedon Feb 2, 2023
@tgross35 I personally think that all of these are uncontroversial and I'd be very comfortable stabilizing them, however I do not posses the power to do so. Stabilizing library APIs is a prerogative of
T-libs-api.tgross35 commentedon Feb 2, 2023
Rightieo, I just was wondering if you had any bad feeling that any of them would be unmaintainable as const.
I think the FCP could take place on the PR since this is quite small, similarly to #107429. Would you like to make the stabilization PR? If not, I don't mind doing it tomorrow. (in either case, using my commit 877e9f5 as a base is likely a good idea to avoid a smidge of rebasing once #107429 is in)
WaffleLapkin commentedon Feb 2, 2023
I'll live the PR to you :)
tgross35 commentedon Feb 3, 2023
Alright, I've opened #107624
Rollup merge of #102961 - reitermarkus:const-cstr-from-ptr, r=oli-obk
Rollup merge of rust-lang#107624 - tgross35:const-cstr-methods, r=dto…
Rollup merge of rust-lang#107624 - tgross35:const-cstr-methods, r=dto…
tgross35 commentedon Jul 1, 2023
@WaffleLapkin I think you can close this tracking issue if you would like, since #107624 merged.
CStr::from_ptrwas under this gate (I don't see it in this description) but moved toconst_cstr_from_ptrwith the merge, and I opened a new issue to track that #113219Update the tracking issue for `const_cstr_from_ptr`
Rollup merge of rust-lang#113252 - tgross35:const-cstr-from-ptr-track…
Rollup merge of rust-lang#113252 - tgross35:const-cstr-from-ptr-track…
Rollup merge of rust-lang#113252 - tgross35:const-cstr-from-ptr-track…