Closed
Description
Feature gate: #![feature(proc_macro_byte_character)]
This is a tracking issue for Literal::byte_character
, enabling the creation of a Literal
with LitKind::Byte
, representing b'a'
.
Public API
impl Literal {
pub fn byte_character(byte: u8) -> Literal;
}
Steps / History
- Implementation: implement Literal::byte_character #112711Final comment period (FCP)1Stabilization PR
Unresolved Questions
- None yet.
Activity
[-]Tracking Issue for XXX[/-][+]Tracking Issue for `proc_macro_byte_character`[/+][-]Tracking Issue for `proc_macro_byte_character`[/-][+]Tracking Issue for `Literal::byte_character`[/+]Auto merge of rust-lang#112711 - Emilgardis:lit_byte_char, r=dtolnay
dtolnay commentedon Mar 24, 2024
@rust-lang/libs-api:
@rfcbot fcp merge
Previously available alternatives for forming a byte literal:
Literal::u8_suffixed(byte)
constructs a literal like97u8
format!("b'\\x{:02x}'", byte).parse::<Literal>().unwrap()
constructs a literal likeb'\x61'
format!("b'{}'", [byte].escape_ascii()).parse::<Literal>().unwrap()
constructs a literal likeb'a'
This feature adds
Literal::byte_character(byte)
which is equivalent to the third alternative, as it is most often the one you want but is fairly challenging to come up with on your own.rfcbot commentedon Mar 24, 2024
Team member @dtolnay 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.
rfcbot commentedon Mar 24, 2024
🔔 This is now entering its final comment period, as per the review above. 🔔
27 remaining items