Open
Description
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
- ACP
- Implementation
- Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- None yet.