@@ -377,7 +377,7 @@ impl CStr {
377
377
/// assert!(cstr.is_err());
378
378
/// ```
379
379
#[ stable( feature = "cstr_from_bytes" , since = "1.10.0" ) ]
380
- #[ rustc_const_stable( feature = "const_cstr_methods" , since = "CURRENT_RUSTC_VERSION " ) ]
380
+ #[ rustc_const_stable( feature = "const_cstr_methods" , since = "1.72.0 " ) ]
381
381
pub const fn from_bytes_with_nul ( bytes : & [ u8 ] ) -> Result < & Self , FromBytesWithNulError > {
382
382
let nul_pos = memchr:: memchr ( 0 , bytes) ;
383
383
match nul_pos {
@@ -561,7 +561,7 @@ impl CStr {
561
561
#[ must_use = "this returns the result of the operation, \
562
562
without modifying the original"]
563
563
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
564
- #[ rustc_const_stable( feature = "const_cstr_methods" , since = "CURRENT_RUSTC_VERSION " ) ]
564
+ #[ rustc_const_stable( feature = "const_cstr_methods" , since = "1.72.0 " ) ]
565
565
pub const fn to_bytes ( & self ) -> & [ u8 ] {
566
566
let bytes = self . to_bytes_with_nul ( ) ;
567
567
// FIXME(const-hack) replace with range index
@@ -590,7 +590,7 @@ impl CStr {
590
590
#[ must_use = "this returns the result of the operation, \
591
591
without modifying the original"]
592
592
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
593
- #[ rustc_const_stable( feature = "const_cstr_methods" , since = "CURRENT_RUSTC_VERSION " ) ]
593
+ #[ rustc_const_stable( feature = "const_cstr_methods" , since = "1.72.0 " ) ]
594
594
pub const fn to_bytes_with_nul ( & self ) -> & [ u8 ] {
595
595
// SAFETY: Transmuting a slice of `c_char`s to a slice of `u8`s
596
596
// is safe on all supported targets.
@@ -614,7 +614,7 @@ impl CStr {
614
614
/// assert_eq!(cstr.to_str(), Ok("foo"));
615
615
/// ```
616
616
#[ stable( feature = "cstr_to_str" , since = "1.4.0" ) ]
617
- #[ rustc_const_stable( feature = "const_cstr_methods" , since = "CURRENT_RUSTC_VERSION " ) ]
617
+ #[ rustc_const_stable( feature = "const_cstr_methods" , since = "1.72.0 " ) ]
618
618
pub const fn to_str ( & self ) -> Result < & str , str:: Utf8Error > {
619
619
// N.B., when `CStr` is changed to perform the length check in `.to_bytes()`
620
620
// instead of in `from_ptr()`, it may be worth considering if this should
0 commit comments