summaryrefslogtreecommitdiffstats
path: root/tests/ui/pattern/usefulness/issue-105479-str-non-exhaustiveness.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/pattern/usefulness/issue-105479-str-non-exhaustiveness.rs')
-rw-r--r--tests/ui/pattern/usefulness/issue-105479-str-non-exhaustiveness.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/pattern/usefulness/issue-105479-str-non-exhaustiveness.rs b/tests/ui/pattern/usefulness/issue-105479-str-non-exhaustiveness.rs
new file mode 100644
index 000000000..0ee7856c6
--- /dev/null
+++ b/tests/ui/pattern/usefulness/issue-105479-str-non-exhaustiveness.rs
@@ -0,0 +1,12 @@
+fn main() {
+ let a = "";
+ let b = "";
+ match (a, b) {
+ //~^ ERROR non-exhaustive patterns: `(&_, _)` not covered [E0004]
+ //~| NOTE pattern `(&_, _)` not covered
+ //~| NOTE the matched value is of type `(&str, &str)`
+ //~| NOTE `&str` cannot be matched exhaustively, so a wildcard `_` is necessary
+ ("a", "b") => {}
+ ("c", "d") => {}
+ }
+}