deprecate std::char constants and functions#153873
deprecate std::char constants and functions#153873rust-bors[bot] merged 1 commit intorust-lang:mainfrom
std::char constants and functions#153873Conversation
3d35ff3 to
00b5d46
Compare
std::char::MAXstd::char constants and functions
This comment has been minimized.
This comment has been minimized.
| /// The maximum number of bytes required to [encode](char::encode_utf8) a `char` to | ||
| /// UTF-8 encoding. | ||
| #[unstable(feature = "char_max_len", issue = "121714")] | ||
| pub const MAX_LEN_UTF8: usize = char::MAX_LEN_UTF8; | ||
|
|
||
| /// The maximum number of two-byte units required to [encode](char::encode_utf16) a `char` | ||
| /// to UTF-16 encoding. | ||
| #[unstable(feature = "char_max_len", issue = "121714")] | ||
| pub const MAX_LEN_UTF16: usize = char::MAX_LEN_UTF16; |
There was a problem hiding this comment.
There is currently no core::char::consts module, so currently these constants are just gone. Should they be added as associated consts, or should that core::char::consts module be added?
There was a problem hiding this comment.
note to self: the consts being gone completely is the cause of the char_max_len CI failure.
There was a problem hiding this comment.
They already are associated consts: https://doc.rust-lang.org/stable/std/primitive.char.html#associatedconstant.MAX_LEN_UTF8
And were stabilized under the feature char_max_len_assoc
There was a problem hiding this comment.
Nice, these can probably just be removed then.
similar to how constants in those modules for numeric types have been deprecated
00b5d46 to
ee9b61c
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@rfcbot merge libs-api |
|
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. |
|
The only downside of a deprecation is that we still don't support |
|
@rfcbot reviewed |
|
🔔 This is now entering its final comment period, as per the review above. 🔔 |
What do you mean by "method equivalents"? They link to associated const alternatives, not methods. |
|
Must have been a copy-paste error. fixed. |
|
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. |
|
r? libs |
|
@bors r+ rollup |
…ark-Simulacrum deprecate `std::char` constants and functions similar to how constants in those modules for numeric types have been deprecated. The `std::char` module contains: Three stable constants that this PR deprecates. These already link to their associated constant equivalents. - `MAX` - `REPLACEMENT_CHARACTER` - `UNICODE_VERSION` two unstable constants that this PR removes. The constants are already stablized as associated constants on `char`. - `MAX_LEN_UTF8` - `MAX_LEN_UTF16` Four stable functions that this PR deprecates. These already link to their method equivalents. - `fn decode_utf16` - `fn from_digit` - `fn from_u32` - `fn from_u32_unchecked⚠` discussion at [#t-libs > should &rust-lang#96;std::char::{MIN, MAX}&rust-lang#96; be deprecated?](https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/should.20.60std.3A.3Achar.3A.3A.7BMIN.2C.20MAX.7D.60.20be.20deprecated.3F/with/579444750). r? libs-api
Rollup of 8 pull requests Successful merges: - #155370 (Add regression test for dead code elimination with drop + panic) - #154823 (Replace the spdx-rs dependency with a minimal in-tree SPDX tag-value parser) - #155352 (triagebot.toml: Sync `assign.owners` with `autolabel."T-compiler"`) - #155431 (Add temporary scope to assert_matches) - #152995 (ACP Implementation of PermissionsExt for Windows ) - #153873 (deprecate `std::char` constants and functions) - #154654 (Move `std::io::ErrorKind` to `core::io`) - #154865 (libtest: use binary search for --exact test filtering)
…ark-Simulacrum deprecate `std::char` constants and functions similar to how constants in those modules for numeric types have been deprecated. The `std::char` module contains: Three stable constants that this PR deprecates. These already link to their associated constant equivalents. - `MAX` - `REPLACEMENT_CHARACTER` - `UNICODE_VERSION` two unstable constants that this PR removes. The constants are already stablized as associated constants on `char`. - `MAX_LEN_UTF8` - `MAX_LEN_UTF16` Four stable functions that this PR deprecates. These already link to their method equivalents. - `fn decode_utf16` - `fn from_digit` - `fn from_u32` - `fn from_u32_unchecked⚠` discussion at [#t-libs > should &rust-lang#96;std::char::{MIN, MAX}&rust-lang#96; be deprecated?](https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/should.20.60std.3A.3Achar.3A.3A.7BMIN.2C.20MAX.7D.60.20be.20deprecated.3F/with/579444750). r? libs-api
Rollup of 9 pull requests Successful merges: - #155370 (Add regression test for dead code elimination with drop + panic) - #154823 (Replace the spdx-rs dependency with a minimal in-tree SPDX tag-value parser) - #154972 (Implement `core::arch::return_address` and tests) - #155294 (Add test for coalescing of diagnostic attribute duplicates) - #155352 (triagebot.toml: Sync `assign.owners` with `autolabel."T-compiler"`) - #155431 (Add temporary scope to assert_matches) - #152995 (ACP Implementation of PermissionsExt for Windows ) - #153873 (deprecate `std::char` constants and functions) - #154865 (libtest: use binary search for --exact test filtering)
…ark-Simulacrum deprecate `std::char` constants and functions similar to how constants in those modules for numeric types have been deprecated. The `std::char` module contains: Three stable constants that this PR deprecates. These already link to their associated constant equivalents. - `MAX` - `REPLACEMENT_CHARACTER` - `UNICODE_VERSION` two unstable constants that this PR removes. The constants are already stablized as associated constants on `char`. - `MAX_LEN_UTF8` - `MAX_LEN_UTF16` Four stable functions that this PR deprecates. These already link to their method equivalents. - `fn decode_utf16` - `fn from_digit` - `fn from_u32` - `fn from_u32_unchecked⚠` discussion at [#t-libs > should &rust-lang#96;std::char::{MIN, MAX}&rust-lang#96; be deprecated?](https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/should.20.60std.3A.3Achar.3A.3A.7BMIN.2C.20MAX.7D.60.20be.20deprecated.3F/with/579444750). r? libs-api
Rollup of 10 pull requests Successful merges: - #155370 (Add regression test for dead code elimination with drop + panic) - #154823 (Replace the spdx-rs dependency with a minimal in-tree SPDX tag-value parser) - #155294 (Add test for coalescing of diagnostic attribute duplicates) - #155352 (triagebot.toml: Sync `assign.owners` with `autolabel."T-compiler"`) - #155431 (Add temporary scope to assert_matches) - #152995 (ACP Implementation of PermissionsExt for Windows ) - #153873 (deprecate `std::char` constants and functions) - #154865 (libtest: use binary search for --exact test filtering) - #154979 (add #[must_use] macros for floats) - #155504 (Remove `AttributeLintKind` variants - part 2)
…uwer Rollup of 12 pull requests Successful merges: - #155370 (Add regression test for dead code elimination with drop + panic) - #154823 (Replace the spdx-rs dependency with a minimal in-tree SPDX tag-value parser) - #155294 (Add test for coalescing of diagnostic attribute duplicates) - #155352 (triagebot.toml: Sync `assign.owners` with `autolabel."T-compiler"`) - #155431 (Add temporary scope to assert_matches) - #153873 (deprecate `std::char` constants and functions) - #154865 (libtest: use binary search for --exact test filtering) - #154979 (add #[must_use] macros for floats) - #155486 (c-variadic: add roundtrip test) - #155504 (Remove `AttributeLintKind` variants - part 2) - #155510 (Update Tidy python executable path) - #155514 (codegen-options docs: remove -Csoft-float)
Rollup merge of #153873 - folkertdev:deprecate-char-max, r=Mark-Simulacrum deprecate `std::char` constants and functions similar to how constants in those modules for numeric types have been deprecated. The `std::char` module contains: Three stable constants that this PR deprecates. These already link to their associated constant equivalents. - `MAX` - `REPLACEMENT_CHARACTER` - `UNICODE_VERSION` two unstable constants that this PR removes. The constants are already stablized as associated constants on `char`. - `MAX_LEN_UTF8` - `MAX_LEN_UTF16` Four stable functions that this PR deprecates. These already link to their method equivalents. - `fn decode_utf16` - `fn from_digit` - `fn from_u32` - `fn from_u32_unchecked⚠` discussion at [#t-libs > should `std::char::{MIN, MAX}` be deprecated?](https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/should.20.60std.3A.3Achar.3A.3A.7BMIN.2C.20MAX.7D.60.20be.20deprecated.3F/with/579444750). r? libs-api
similar to how constants in those modules for numeric types have been deprecated. The
std::charmodule contains:Three stable constants that this PR deprecates. These already link to their associated constant equivalents.
MAXREPLACEMENT_CHARACTERUNICODE_VERSIONtwo unstable constants that this PR removes. The constants are already stablized as associated constants on
char.MAX_LEN_UTF8MAX_LEN_UTF16Four stable functions that this PR deprecates. These already link to their method equivalents.
fn decode_utf16fn from_digitfn from_u32fn from_u32_unchecked⚠discussion at #t-libs > should `std::char::{MIN, MAX}` be deprecated?.
r? libs-api