-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Add new byte_value and char_value methods to proc_macro::Literal
#151543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new byte_value and char_value methods to proc_macro::Literal
#151543
Conversation
library/proc_macro/src/lib.rs
Outdated
|
|
||
| /// Returns the unescaped char value if the current literal is a char. | ||
| #[unstable(feature = "proc_macro_value", issue = "136652")] | ||
| pub fn char_value(&self) -> Result<char, ConversionErrorKind> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name should be consistent with the corresponding constructor.
| pub fn char_value(&self) -> Result<char, ConversionErrorKind> { | |
| pub fn character_value(&self) -> Result<char, ConversionErrorKind> { |
library/proc_macro/src/lib.rs
Outdated
|
|
||
| /// Returns the unescaped char value if the current literal is a char. | ||
| #[unstable(feature = "proc_macro_value", issue = "136652")] | ||
| pub fn byte_value(&self) -> Result<u8, ConversionErrorKind> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
| pub fn byte_value(&self) -> Result<u8, ConversionErrorKind> { | |
| pub fn byte_character_value(&self) -> Result<u8, ConversionErrorKind> { |
library/proc_macro/src/lib.rs
Outdated
| }) | ||
| } | ||
|
|
||
| /// Returns the unescaped char value if the current literal is a char. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /// Returns the unescaped char value if the current literal is a char. | |
| /// Returns the unescaped character value if the current literal is a byte character literal. |
library/proc_macro/src/lib.rs
Outdated
| }) | ||
| } | ||
|
|
||
| /// Returns the unescaped char value if the current literal is a char. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /// Returns the unescaped char value if the current literal is a char. | |
| /// Returns the unescaped character value if the current literal is a character literal. |
|
@bors r+ |
…eral-methods, r=Amanieu Add new `byte_value` and `char_value` methods to `proc_macro::Literal` Part of rust-lang#136652. It adds two more methods to get unescaped `u8` and `char` from `proc_macro::Literal`. r? @Amanieu
This comment has been minimized.
This comment has been minimized.
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing b7fb220 (parent) -> 8340622 (this PR) Test differencesShow 1 test diff1 doctest diff were found. These are ignored, as they are noisy. Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 8340622e14324d0090a6edf42fce44fea3d7824f --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (8340622): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesResults (secondary -3.6%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 0.1%, secondary 0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 478.155s -> 472.577s (-1.17%) |
Part of #136652.
It adds two more methods to get unescaped
u8andcharfromproc_macro::Literal.r? @Amanieu