about summary refs log tree commit diff
path: root/compiler/rustc_parse_format
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2025-03-18 13:28:56 +0100
committerRalf Jung <post@ralfj.de>2025-03-18 13:28:56 +0100
commit20d04d8a4029a2b0d07c7b41a64e420c493def0c (patch)
tree54cc9b6e3fde104e70bad7f9269eea7e27a80047 /compiler/rustc_parse_format
parent75530e9f72a1990ed2305e16fd51d02f47048f12 (diff)
downloadrust-20d04d8a4029a2b0d07c7b41a64e420c493def0c.tar.gz
rust-20d04d8a4029a2b0d07c7b41a64e420c493def0c.zip
Revert "Rollup merge of #136355 - GuillaumeGomez:proc-macro_add_value_retrieval_methods, r=Amanieu"
This reverts commit 08dfbf49e30d917c89e49eb14cb3f1e8b8a1c9ef, reversing
changes made to 10bcdad7df0de3cfb95c7bdb7b16908e73cafc09.
Diffstat (limited to 'compiler/rustc_parse_format')
-rw-r--r--compiler/rustc_parse_format/Cargo.toml1
-rw-r--r--compiler/rustc_parse_format/src/lib.rs11
2 files changed, 5 insertions, 7 deletions
diff --git a/compiler/rustc_parse_format/Cargo.toml b/compiler/rustc_parse_format/Cargo.toml
index e63ed9e16f2..a39cca716d2 100644
--- a/compiler/rustc_parse_format/Cargo.toml
+++ b/compiler/rustc_parse_format/Cargo.toml
@@ -5,7 +5,6 @@ edition = "2024"
 
 [dependencies]
 # tidy-alphabetical-start
-literal-escaper = { path = "../../library/literal-escaper" }
 rustc_index = { path = "../rustc_index", default-features = false }
 rustc_lexer = { path = "../rustc_lexer" }
 # tidy-alphabetical-end
diff --git a/compiler/rustc_parse_format/src/lib.rs b/compiler/rustc_parse_format/src/lib.rs
index 5780daf3034..5b8a2fe52d3 100644
--- a/compiler/rustc_parse_format/src/lib.rs
+++ b/compiler/rustc_parse_format/src/lib.rs
@@ -18,6 +18,7 @@
 pub use Alignment::*;
 pub use Count::*;
 pub use Position::*;
+use rustc_lexer::unescape;
 
 // Note: copied from rustc_span
 /// Range inside of a `Span` used for diagnostics when we only have access to relative positions.
@@ -1093,14 +1094,12 @@ fn find_width_map_from_snippet(
 fn unescape_string(string: &str) -> Option<String> {
     let mut buf = String::new();
     let mut ok = true;
-    literal_escaper::unescape_unicode(
-        string,
-        literal_escaper::Mode::Str,
-        &mut |_, unescaped_char| match unescaped_char {
+    unescape::unescape_unicode(string, unescape::Mode::Str, &mut |_, unescaped_char| {
+        match unescaped_char {
             Ok(c) => buf.push(c),
             Err(_) => ok = false,
-        },
-    );
+        }
+    });
 
     ok.then_some(buf)
 }