Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion library/std/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2107,7 +2107,7 @@ impl PartialEq for PathBuf {
impl cmp::PartialEq<str> for PathBuf {
#[inline]
fn eq(&self, other: &str) -> bool {
&*self == other
Path::eq(self, other)
}
}

Expand Down
6 changes: 6 additions & 0 deletions library/std/tests/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2526,3 +2526,9 @@ fn normalize_lexically() {
check_err(r"\\?\UNC\server\share\a\..\..");
}
}

#[test]
/// See issue#146183
fn compare_path_to_str() {
assert!(&PathBuf::from("x") == "x");
}
Loading