Repository navigation
Stabilize proc_macro_value feature - #151973
GuillaumeGomez wants to merge 1 commit into
Conversation
|
r? @dtolnay |
|
I'm not sure if we should be stabilizing this without at least a sketch for the the integer value API, but I'm not the best person to determine this since I haven't used the proc macro API much. |
This comment has been minimized.
This comment has been minimized.
…e, r=traviscross,Mark-Simulacrum Make `Literal::byte_character_value` work with bytes as well As noted in [this comment](rust-lang#151973 (comment)), `byte_character_value` should work for bytes, so this PR fixes it. r? @traviscross
…e, r=traviscross,Mark-Simulacrum Make `Literal::byte_character_value` work with bytes as well As noted in [this comment](rust-lang#151973 (comment)), `byte_character_value` should work for bytes, so this PR fixes it. r? @traviscross
Rollup merge of #157338 - GuillaumeGomez:byte_character_value, r=traviscross,Mark-Simulacrum Make `Literal::byte_character_value` work with bytes as well As noted in [this comment](#151973 (comment)), `byte_character_value` should work for bytes, so this PR fixes it. r? @traviscross
…iscross,Mark-Simulacrum Make `Literal::byte_character_value` work with bytes as well As noted in [this comment](rust-lang/rust#151973 (comment)), `byte_character_value` should work for bytes, so this PR fixes it. r? @traviscross
d96083f to
300da0f
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. |
|
Fixed merge conflict. Are there any concerns remaining or should we start an FCP? |
…-non-exhaustive, r=traviscross,Mark-Simulacrum Make `proc_macro::ConversionErrorKind` non exhaustive Needed for rust-lang#151973. r? @traviscross
…-non-exhaustive, r=traviscross,Mark-Simulacrum Make `proc_macro::ConversionErrorKind` non exhaustive Needed for rust-lang#151973. r? @traviscross
…-non-exhaustive, r=traviscross,Mark-Simulacrum Make `proc_macro::ConversionErrorKind` non exhaustive Needed for rust-lang#151973. r? @traviscross
Rollup merge of #157935 - GuillaumeGomez:ConversionErrorKind-non-exhaustive, r=traviscross,Mark-Simulacrum Make `proc_macro::ConversionErrorKind` non exhaustive Needed for #151973. r? @traviscross
|
All suggestions were implemented. cc @traviscross |
|
ping @rust-lang/libs-api |
…iscross,Mark-Simulacrum Make `Literal::byte_character_value` work with bytes as well As noted in [this comment](rust-lang/rust#151973 (comment)), `byte_character_value` should work for bytes, so this PR fixes it. r? @traviscross
|
@rustbot label:I-libs-nominated |
|
r? libs |
|
@rfcbot fcp merge libs |
|
@nia-e 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! cc @rust-lang/libs-ping: FCP proposed for libs, please feel free to register concerns. |
| #[stable(feature = "proc_macro_value", since = "CURRENT_RUSTC_VERSION")] | ||
| #[derive(Debug, PartialEq, Eq)] | ||
| #[non_exhaustive] | ||
| pub enum EscapeError { |
There was a problem hiding this comment.
I think this should be a struct wrapping a private enum -- several of the existing enum variants would be immediately obsolete when in-progress changes are stabilized, e.g. NonAsciiCharInByte with https://github.com/rust-lang/rfcs/blob/3bdcd22feea6848a7920fa06d17ad4c6ada9db89/text/3349-mixed-utf8-literals.md
| /// literal. | ||
| #[unstable(feature = "proc_macro_value", issue = "136652")] | ||
| #[stable(feature = "proc_macro_value", since = "CURRENT_RUSTC_VERSION")] | ||
| pub fn cstr_value(&self) -> Result<Vec<u8>, ConversionErrorKind> { |
There was a problem hiding this comment.
why not return CString?
…api, r=programmerjake Make `Literal::cstr_value` return a `CString` Part of rust-lang#136652, suggested [here](rust-lang#151973 (comment)). r? @programmerjake
Rollup merge of #165550 - GuillaumeGomez:proc-macro-literal-api, r=programmerjake Make `Literal::cstr_value` return a `CString` Part of #136652, suggested [here](#151973 (comment)). r? @programmerjake
|
☔ The latest upstream changes (presumably #165579) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
View all comments
Fixes #136652.
The feature implementation is complete: all string related values now have their
_valuemethod andproc_macro2integration seems to be working as expected.Integers are voluntarily left untouched as an equivalent API for them is much trickier to provide. I'll open an ACP once I come up with a design I'm happy with.
r? @Amanieu