Skip to content

Tracking issue for proc_macro_value #136652

Open
@GuillaumeGomez

Description

@GuillaumeGomez

Feature gate: #![feature(proc_macro_value)]

This feature provides methods on proc_macro::Literal to get their unescaped string equivalent.

Public API

For now, the only choice to get these values is to either copy-paste rustc's source code or use syn which has more or less the same code to achieve the same result.

After this change, one will be able to do:

// The one provided by `proc-macro`.
let literal_string = Literal::String { .. };

let unescaped_string_literal = literal_string.str_value().expect("failed to unescape");

Steps / History

Unresolved Questions

  • None yet.

Footnotes

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

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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions