about summary refs log tree commit diff
path: root/compiler/rustc_parse_format
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-03-19 12:39:34 +0000
committerbors <bors@rust-lang.org>2025-03-19 12:39:34 +0000
commita7fc463dd8fbeca800d4b3efc501069502cffe64 (patch)
tree097c6944fd8660666094e1c1f7adfca493dd37dc /compiler/rustc_parse_format
parentc4b38a596767c9c6275c937cf3a2d4b9612b4875 (diff)
parent3b7faca09c7a2e86390e354e83cb1acac6b3a1fd (diff)
downloadrust-a7fc463dd8fbeca800d4b3efc501069502cffe64.tar.gz
rust-a7fc463dd8fbeca800d4b3efc501069502cffe64.zip
Auto merge of #138693 - matthiaskrgr:rollup-ejq8mwp, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #136177 (clarify BufRead::{fill_buf, consume} docs)
 - #138654 (Remove the regex dependency from coretests)
 - #138655 (rustc-dev-guide sync)
 - #138656 (Remove double nesting in post-merge workflow)
 - #138658 (CI: mirror alpine and centos images to ghcr)
 - #138659 (coverage: Don't store a body span in `FunctionCoverageInfo`)
 - #138661 (Revert: Add *_value methods to proc_macro lib)
 - #138670 (Remove existing AFIDT implementation)
 - #138674 (Various codegen_llvm cleanups)
 - #138684 (use then in docs for `fuse` to enhance readability)

r? `@ghost`
`@rustbot` modify labels: rollup
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)
 }