about summary refs log tree commit diff
path: root/tests/ui/inference
diff options
context:
space:
mode:
authorStuart Cook <Zalathar@users.noreply.github.com>2025-08-19 14:18:14 +1000
committerGitHub <noreply@github.com>2025-08-19 14:18:14 +1000
commit2beb54c451426f8f74c66d4587fcb331f14416f8 (patch)
treeceace1bdf3de0f26e54c45696d7ab63701c7302f /tests/ui/inference
parentb96868fa2ef174b0a5aeb3bf041b3a5b517f11f8 (diff)
parentaab1563d42ed7cf54b017ad414f95fa45526f566 (diff)
downloadrust-2beb54c451426f8f74c66d4587fcb331f14416f8.tar.gz
rust-2beb54c451426f8f74c66d4587fcb331f14416f8.zip
Rollup merge of #140956 - Kixunil:impl-partialeq-str-for-path, r=Amanieu
`impl PartialEq<{str,String}> for {Path,PathBuf}`

This is a revival of #105877

Comparison of paths and strings is expected to be possible and needed e.g. in tests. This change adds the impls os `PartialEq` between strings and paths, both owned and unsized, in both directions.

ACP: https://github.com/rust-lang/libs-team/issues/151
Diffstat (limited to 'tests/ui/inference')
-rw-r--r--tests/ui/inference/issue-72616.stderr12
1 files changed, 4 insertions, 8 deletions
diff --git a/tests/ui/inference/issue-72616.stderr b/tests/ui/inference/issue-72616.stderr
index 31a0586301d..a271639996f 100644
--- a/tests/ui/inference/issue-72616.stderr
+++ b/tests/ui/inference/issue-72616.stderr
@@ -6,14 +6,10 @@ LL |         if String::from("a") == "a".try_into().unwrap() {}
    |                              |
    |                              type must be known at this point
    |
-   = note: cannot satisfy `String: PartialEq<_>`
-   = help: the following types implement trait `PartialEq<Rhs>`:
-             `String` implements `PartialEq<&str>`
-             `String` implements `PartialEq<ByteStr>`
-             `String` implements `PartialEq<ByteString>`
-             `String` implements `PartialEq<Cow<'_, str>>`
-             `String` implements `PartialEq<str>`
-             `String` implements `PartialEq`
+   = note: multiple `impl`s satisfying `String: PartialEq<_>` found in the following crates: `alloc`, `std`:
+           - impl PartialEq for String;
+           - impl PartialEq<Path> for String;
+           - impl PartialEq<PathBuf> for String;
 help: try using a fully qualified path to specify the expected types
    |
 LL -         if String::from("a") == "a".try_into().unwrap() {}