1
Fork 0

Rollup merge of #139367 - GuillaumeGomez:proc-macro-values, r=Urgau

Add `*_value` methods to proc_macro lib

This is the (re-)implementation of https://github.com/rust-lang/libs-team/issues/459.

It allows to get the actual value (unescaped) of the different string literals.

It was originally done in https://github.com/rust-lang/rust/pull/136355 but it broke the artifacts build so we decided to move the crate to crates.io to go around this limitation.

Part of https://github.com/rust-lang/rust/issues/136652.

Considering this is a copy-paste of the originally approved PR, no need to go through the whole process again. \o/

r? `@Urgau`
This commit is contained in:
Guillaume Gomez 2025-04-06 18:08:10 +02:00 committed by GitHub
commit ed81e347f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 173 additions and 765 deletions

View file

@ -21,7 +21,7 @@ use rustc_ast::{
};
use rustc_data_structures::stack::ensure_sufficient_stack;
use rustc_errors::{Applicability, Diag, PResult, StashKey, Subdiagnostic};
use rustc_lexer::unescape::unescape_char;
use rustc_literal_escaper::unescape_char;
use rustc_macros::Subdiagnostic;
use rustc_session::errors::{ExprParenthesesNeeded, report_lit_error};
use rustc_session::lint::BuiltinLintDiag;