about summary refs log tree commit diff
path: root/compiler/rustc_parse_format/src/tests.rs
diff options
context:
space:
mode:
authorLeón Orell Valerian Liehr <me@fmease.dev>2025-01-29 03:12:19 +0100
committerGitHub <noreply@github.com>2025-01-29 03:12:19 +0100
commitdbb092b671a9b0d8d17447b4bca3766d8731ccef (patch)
treeece62aaa6ba33d7621611c08218923c32709e3de /compiler/rustc_parse_format/src/tests.rs
parent42f46437bacd23d092f04271d4011902b7b44db2 (diff)
parent3026545ab50e65fcd1c888b77272032000e36147 (diff)
downloadrust-dbb092b671a9b0d8d17447b4bca3766d8731ccef.tar.gz
rust-dbb092b671a9b0d8d17447b4bca3766d8731ccef.zip
Rollup merge of #135943 - hkBst:opt_imports, r=estebank
Rename `Piece::String` to `Piece::Lit`

This renames Piece::String to Piece::Lit to avoid shadowing std::string::String and removes "pub use Piece::*;".
Diffstat (limited to 'compiler/rustc_parse_format/src/tests.rs')
-rw-r--r--compiler/rustc_parse_format/src/tests.rs18
1 files changed, 10 insertions, 8 deletions
diff --git a/compiler/rustc_parse_format/src/tests.rs b/compiler/rustc_parse_format/src/tests.rs
index 81e5bca0ba9..fbb217b16fc 100644
--- a/compiler/rustc_parse_format/src/tests.rs
+++ b/compiler/rustc_parse_format/src/tests.rs
@@ -1,3 +1,5 @@
+use Piece::*;
+
 use super::*;
 
 #[track_caller]
@@ -32,12 +34,12 @@ fn musterr(s: &str) {
 
 #[test]
 fn simple() {
-    same("asdf", &[String("asdf")]);
-    same("a{{b", &[String("a"), String("{b")]);
-    same("a}}b", &[String("a"), String("}b")]);
-    same("a}}", &[String("a"), String("}")]);
-    same("}}", &[String("}")]);
-    same("\\}}", &[String("\\"), String("}")]);
+    same("asdf", &[Lit("asdf")]);
+    same("a{{b", &[Lit("a"), Lit("{b")]);
+    same("a}}b", &[Lit("a"), Lit("}b")]);
+    same("a}}", &[Lit("a"), Lit("}")]);
+    same("}}", &[Lit("}")]);
+    same("\\}}", &[Lit("\\"), Lit("}")]);
 }
 
 #[test]
@@ -370,7 +372,7 @@ fn format_flags() {
 #[test]
 fn format_mixture() {
     same("abcd {3:x} efg", &[
-        String("abcd "),
+        Lit("abcd "),
         NextArgument(Box::new(Argument {
             position: ArgumentIs(3),
             position_span: InnerSpan { start: 7, end: 8 },
@@ -390,7 +392,7 @@ fn format_mixture() {
                 ty_span: None,
             },
         })),
-        String(" efg"),
+        Lit(" efg"),
     ]);
 }
 #[test]