Rollup merge of #131496 - bjoernager:const-make-ascii, r=dtolnay · qinheping/verify-rust-std@54072ab (original) (raw)
5 files changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1282,8 +1282,9 @@ impl char { | ||
1282 | 1282 | /// |
1283 | 1283 | /// [`to_ascii_uppercase()`]: #method.to_ascii_uppercase |
1284 | 1284 | #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] |
1285 | -#[rustc_const_unstable(feature = "const_make_ascii", issue = "130698")] | |
1285 | +#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")] | |
1286 | 1286 | #[inline] |
1287 | +#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))] | |
1287 | 1288 | pub const fn make_ascii_uppercase(&mut self) { |
1288 | 1289 | *self = self.to_ascii_uppercase(); |
1289 | 1290 | } |
@@ -1308,8 +1309,9 @@ impl char { | ||
1308 | 1309 | /// |
1309 | 1310 | /// [`to_ascii_lowercase()`]: #method.to_ascii_lowercase |
1310 | 1311 | #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] |
1311 | -#[rustc_const_unstable(feature = "const_make_ascii", issue = "130698")] | |
1312 | +#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")] | |
1312 | 1313 | #[inline] |
1314 | +#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))] | |
1313 | 1315 | pub const fn make_ascii_lowercase(&mut self) { |
1314 | 1316 | *self = self.to_ascii_lowercase(); |
1315 | 1317 | } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -125,7 +125,6 @@ | ||
125 | 125 | #![feature(const_heap)] |
126 | 126 | #![feature(const_index_range_slice_index)] |
127 | 127 | #![feature(const_likely)] |
128 | -#![feature(const_make_ascii)] | |
129 | 128 | #![feature(const_nonnull_new)] |
130 | 129 | #![feature(const_num_midpoint)] |
131 | 130 | #![feature(const_option_ext)] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -624,8 +624,9 @@ impl u8 { | ||
624 | 624 | /// |
625 | 625 | /// [`to_ascii_uppercase`]: Self::to_ascii_uppercase |
626 | 626 | #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] |
627 | -#[rustc_const_unstable(feature = "const_make_ascii", issue = "130698")] | |
627 | +#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")] | |
628 | 628 | #[inline] |
629 | +#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))] | |
629 | 630 | pub const fn make_ascii_uppercase(&mut self) { |
630 | 631 | *self = self.to_ascii_uppercase(); |
631 | 632 | } |
@@ -650,8 +651,9 @@ impl u8 { | ||
650 | 651 | /// |
651 | 652 | /// [`to_ascii_lowercase`]: Self::to_ascii_lowercase |
652 | 653 | #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] |
653 | -#[rustc_const_unstable(feature = "const_make_ascii", issue = "130698")] | |
654 | +#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")] | |
654 | 655 | #[inline] |
656 | +#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))] | |
655 | 657 | pub const fn make_ascii_lowercase(&mut self) { |
656 | 658 | *self = self.to_ascii_lowercase(); |
657 | 659 | } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -67,8 +67,9 @@ impl [u8] { | ||
67 | 67 | /// |
68 | 68 | /// [`to_ascii_uppercase`]: #method.to_ascii_uppercase |
69 | 69 | #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] |
70 | -#[rustc_const_unstable(feature = "const_make_ascii", issue = "130698")] | |
70 | +#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")] | |
71 | 71 | #[inline] |
72 | +#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))] | |
72 | 73 | pub const fn make_ascii_uppercase(&mut self) { |
73 | 74 | // FIXME(const-hack): We would like to simply iterate using `for` loops but this isn't currently allowed in constant expressions. |
74 | 75 | let mut i = 0; |
@@ -89,8 +90,9 @@ impl [u8] { | ||
89 | 90 | /// |
90 | 91 | /// [`to_ascii_lowercase`]: #method.to_ascii_lowercase |
91 | 92 | #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] |
92 | -#[rustc_const_unstable(feature = "const_make_ascii", issue = "130698")] | |
93 | +#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")] | |
93 | 94 | #[inline] |
95 | +#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))] | |
94 | 96 | pub const fn make_ascii_lowercase(&mut self) { |
95 | 97 | // FIXME(const-hack): We would like to simply iterate using `for` loops but this isn't currently allowed in constant expressions. |
96 | 98 | let mut i = 0; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -2475,8 +2475,9 @@ impl str { | ||
2475 | 2475 | /// assert_eq!("GRüßE, JüRGEN ❤", s); |
2476 | 2476 | /// ``` |
2477 | 2477 | #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] |
2478 | -#[rustc_const_unstable(feature = "const_make_ascii", issue = "130698")] | |
2478 | +#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")] | |
2479 | 2479 | #[inline] |
2480 | +#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))] | |
2480 | 2481 | pub const fn make_ascii_uppercase(&mut self) { |
2481 | 2482 | // SAFETY: changing ASCII letters only does not invalidate UTF-8. |
2482 | 2483 | let me = unsafe { self.as_bytes_mut() }; |
@@ -2503,8 +2504,9 @@ impl str { | ||
2503 | 2504 | /// assert_eq!("grÜße, jÜrgen ❤", s); |
2504 | 2505 | /// ``` |
2505 | 2506 | #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] |
2506 | -#[rustc_const_unstable(feature = "const_make_ascii", issue = "130698")] | |
2507 | +#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")] | |
2507 | 2508 | #[inline] |
2509 | +#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))] | |
2508 | 2510 | pub const fn make_ascii_lowercase(&mut self) { |
2509 | 2511 | // SAFETY: changing ASCII letters only does not invalidate UTF-8. |
2510 | 2512 | let me = unsafe { self.as_bytes_mut() }; |