Skip to content

Tracking Issue for Literal::byte_character #115268

Closed
@Emilgardis

Description

@Emilgardis
Contributor

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

  • Final comment period (FCP)1
    Stabilization PR

Unresolved Questions

  • None yet.

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

Activity

added
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.
on Aug 27, 2023
changed the title [-]Tracking Issue for XXX[/-] [+]Tracking Issue for `proc_macro_byte_character`[/+] on Aug 27, 2023
changed the title [-]Tracking Issue for `proc_macro_byte_character`[/-] [+]Tracking Issue for `Literal::byte_character`[/+] on Aug 27, 2023
added a commit that references this issue on Sep 23, 2023

Auto merge of rust-lang#112711 - Emilgardis:lit_byte_char, r=dtolnay

dtolnay

dtolnay commented on Mar 24, 2024

@dtolnay
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

rfcbot commented on Mar 24, 2024

@rfcbot
Collaborator

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.

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

rfcbot commented on Mar 24, 2024

@rfcbot
Collaborator

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

removed
proposed-final-comment-periodProposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off.
on Mar 24, 2024

27 remaining items

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @Emilgardis@dtolnay@apiraino@mdolberg@rfcbot

      Issue actions

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