about summary refs log tree commit diff
path: root/tests/ui/single_char_pattern.fixed
diff options
context:
space:
mode:
authorPhilipp Krones <hello@philkrones.com>2025-02-27 21:40:02 +0100
committerPhilipp Krones <hello@philkrones.com>2025-02-27 21:51:42 +0100
commit02e812af4d936a0984802bb76bb3e423e2fb94a5 (patch)
tree196fe8bde7074c1a5fa2b0af4a74892c51c8188c /tests/ui/single_char_pattern.fixed
parent17bda0c0febb8c51fb14a6856d365eab86fc6162 (diff)
parent15180d4eb9dcff9441a8c3ff3382804123c5b0a1 (diff)
Merge remote-tracking branch 'upstream/master' into rustup
Diffstat (limited to 'tests/ui/single_char_pattern.fixed')
-rw-r--r--tests/ui/single_char_pattern.fixed37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/ui/single_char_pattern.fixed b/tests/ui/single_char_pattern.fixed
index a18d6319f89..9bf9d663044 100644
--- a/tests/ui/single_char_pattern.fixed
+++ b/tests/ui/single_char_pattern.fixed
@@ -5,6 +5,7 @@ use std::collections::HashSet;
 fn main() {
     let x = "foo";
     x.split('x');
+    //~^ single_char_pattern
     x.split("xx");
     x.split('x');
 
@@ -16,38 +17,67 @@ fn main() {
     // Can't use this lint for unicode code points which don't fit in a char
     x.split("❤️");
     x.split_inclusive('x');
+    //~^ single_char_pattern
     x.contains('x');
+    //~^ single_char_pattern
     x.starts_with('x');
+    //~^ single_char_pattern
     x.ends_with('x');
+    //~^ single_char_pattern
     x.find('x');
+    //~^ single_char_pattern
     x.rfind('x');
+    //~^ single_char_pattern
     x.rsplit('x');
+    //~^ single_char_pattern
     x.split_terminator('x');
+    //~^ single_char_pattern
     x.rsplit_terminator('x');
+    //~^ single_char_pattern
     x.splitn(2, 'x');
+    //~^ single_char_pattern
     x.rsplitn(2, 'x');
+    //~^ single_char_pattern
     x.split_once('x');
+    //~^ single_char_pattern
     x.rsplit_once('x');
+    //~^ single_char_pattern
     x.matches('x');
+    //~^ single_char_pattern
     x.rmatches('x');
+    //~^ single_char_pattern
     x.match_indices('x');
+    //~^ single_char_pattern
     x.rmatch_indices('x');
+    //~^ single_char_pattern
     x.trim_start_matches('x');
+    //~^ single_char_pattern
     x.trim_end_matches('x');
+    //~^ single_char_pattern
     x.replace('x', "y");
+    //~^ single_char_pattern
     x.replacen('x', "y", 3);
+    //~^ single_char_pattern
     // Make sure we escape characters correctly.
     x.split('\n');
+    //~^ single_char_pattern
     x.split('\'');
+    //~^ single_char_pattern
     x.split('\'');
+    //~^ single_char_pattern
     // Issue #11973: Don't escape `"` in `'"'`
     x.split('"');
+    //~^ single_char_pattern
 
     let h = HashSet::<String>::new();
     h.contains("X"); // should not warn
 
     x.replace(';', ",").split(','); // issue #2978
+    //
+    //~^^ single_char_pattern
     x.starts_with('\x03'); // issue #2996
+    //
+    //~^^ single_char_pattern
 
     // Issue #3204
     const S: &str = "#";
@@ -55,13 +85,20 @@ fn main() {
 
     // Raw string
     x.split('a');
+    //~^ single_char_pattern
     x.split('a');
+    //~^ single_char_pattern
     x.split('a');
+    //~^ single_char_pattern
     x.split('\'');
+    //~^ single_char_pattern
     x.split('#');
+    //~^ single_char_pattern
     // Must escape backslash in raw strings when converting to char #8060
     x.split('\\');
+    //~^ single_char_pattern
     x.split('\\');
+    //~^ single_char_pattern
 
     // should not warn, the char versions are actually slower in some cases
     x.strip_prefix("x");