Commit b346ef4
authored
Rollup merge of rust-lang#82078 - lopopolo:char-u8-const-fn, r=m-ou-se
Make char and u8 methods const
char methods `len_utf8`, `len_utf16`, `to_ascii_lowercase`, `eq_ignore_ascii_case` can be made const.
`u8` methods `to_ascii_lowercase`, `to_ascii_uppercase` are required to be const as well.
`u8::eq_ignore_ascii_case` was additionally made const.
Rebase of rust-lang#79549 originally authored by ``@YenForYang.`` Changes from that PR:
- Squashed all commits from rust-lang#79549.
- rebased to latest upstream master.
- Removed const attributes for `char::escape_unicode` and `char::escape_default`.
- Updated `since` attributes for `const` stabilization to 1.52.0.
cc ``@m-ou-se.``2 files changed
+18
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
569 | 569 | | |
570 | 570 | | |
571 | 571 | | |
| 572 | + | |
572 | 573 | | |
573 | | - | |
| 574 | + | |
574 | 575 | | |
575 | 576 | | |
576 | 577 | | |
| |||
594 | 595 | | |
595 | 596 | | |
596 | 597 | | |
| 598 | + | |
597 | 599 | | |
598 | | - | |
| 600 | + | |
599 | 601 | | |
600 | 602 | | |
601 | 603 | | |
| |||
1086 | 1088 | | |
1087 | 1089 | | |
1088 | 1090 | | |
| 1091 | + | |
1089 | 1092 | | |
1090 | | - | |
| 1093 | + | |
1091 | 1094 | | |
1092 | 1095 | | |
1093 | 1096 | | |
| |||
1118 | 1121 | | |
1119 | 1122 | | |
1120 | 1123 | | |
| 1124 | + | |
1121 | 1125 | | |
1122 | | - | |
| 1126 | + | |
1123 | 1127 | | |
1124 | 1128 | | |
1125 | 1129 | | |
| |||
1143 | 1147 | | |
1144 | 1148 | | |
1145 | 1149 | | |
| 1150 | + | |
1146 | 1151 | | |
1147 | | - | |
| 1152 | + | |
1148 | 1153 | | |
1149 | 1154 | | |
1150 | 1155 | | |
| |||
1561 | 1566 | | |
1562 | 1567 | | |
1563 | 1568 | | |
1564 | | - | |
| 1569 | + | |
1565 | 1570 | | |
1566 | 1571 | | |
1567 | 1572 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| 198 | + | |
198 | 199 | | |
199 | | - | |
| 200 | + | |
200 | 201 | | |
201 | 202 | | |
202 | 203 | | |
| |||
218 | 219 | | |
219 | 220 | | |
220 | 221 | | |
| 222 | + | |
221 | 223 | | |
222 | | - | |
| 224 | + | |
223 | 225 | | |
224 | 226 | | |
225 | 227 | | |
226 | 228 | | |
227 | 229 | | |
228 | 230 | | |
229 | | - | |
| 231 | + | |
230 | 232 | | |
231 | 233 | | |
232 | 234 | | |
| |||
243 | 245 | | |
244 | 246 | | |
245 | 247 | | |
| 248 | + | |
246 | 249 | | |
247 | | - | |
| 250 | + | |
248 | 251 | | |
249 | 252 | | |
250 | 253 | | |
| |||
0 commit comments