1

Tracking Issue for `Literal::byte_character` · Issue #115268 · rust-lang/rust ·...

 1 month ago
source link: https://github.com/rust-lang/rust/issues/115268
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Tracking Issue for Literal::byte_character #115268

1 of 3 tasks

Emilgardis opened this issue Aug 27, 2023 · 3 comments

1 of 3 tasks

Comments

Contributor

Emilgardis

commented

Aug 27, 2023

edited by dtolnay

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

Unresolved Questions

  • None yet.
tgross35 and vincenthz reacted with thumbs up emoji

Emilgardis

added C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

labels

Aug 27, 2023

Emilgardis

changed the title Tracking Issue for XXX

Tracking Issue for proc_macro_byte_character

Aug 27, 2023

Emilgardis

changed the title Tracking Issue for proc_macro_byte_character

Tracking Issue for Literal::byte_character

Aug 27, 2023

Member

@rust-lang/libs-api:
@rfcbot fcp merge

Previously available alternatives for forming a byte literal:

  • Literal::u8_suffixed(byte) constructs a literal like 97u8

  • format!("b'\\x{:02x}'", byte).parse::<Literal>().unwrap() constructs a literal like b'\x61'

  • format!("b'{}'", [byte].escape_ascii()).parse::<Literal>().unwrap() constructs a literal like b'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

commented

Mar 24, 2024

edited by m-ou-se

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

added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised.

labels

Mar 24, 2024

🔔 This is now entering its final comment period, as per the review above. 🔔

rfcbot

removed the proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. label

Mar 24, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Assignees

No one assigned

Labels
C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects

None yet

Milestone

No milestone

Development

No branches or pull requests

3 participants

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK