@@ -1885,6 +1885,38 @@ impl cmp::PartialEq for PathBuf {
1885
1885
}
1886
1886
}
1887
1887
1888
+ #[ stable( feature = "eq-str-for-path" , since = "CURRENT_RUSTC_VERSION" ) ]
1889
+ impl cmp:: PartialEq < str > for PathBuf {
1890
+ #[ inline]
1891
+ fn eq ( & self , other : & str ) -> bool {
1892
+ & * self == other
1893
+ }
1894
+ }
1895
+
1896
+ #[ stable( feature = "eq-str-for-path" , since = "CURRENT_RUSTC_VERSION" ) ]
1897
+ impl cmp:: PartialEq < PathBuf > for str {
1898
+ #[ inline]
1899
+ fn eq ( & self , other : & PathBuf ) -> bool {
1900
+ other == self
1901
+ }
1902
+ }
1903
+
1904
+ #[ stable( feature = "eq-str-for-path" , since = "CURRENT_RUSTC_VERSION" ) ]
1905
+ impl cmp:: PartialEq < String > for PathBuf {
1906
+ #[ inline]
1907
+ fn eq ( & self , other : & String ) -> bool {
1908
+ * * self == * * other
1909
+ }
1910
+ }
1911
+
1912
+ #[ stable( feature = "eq-str-for-path" , since = "CURRENT_RUSTC_VERSION" ) ]
1913
+ impl cmp:: PartialEq < PathBuf > for String {
1914
+ #[ inline]
1915
+ fn eq ( & self , other : & PathBuf ) -> bool {
1916
+ other == self
1917
+ }
1918
+ }
1919
+
1888
1920
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1889
1921
impl Hash for PathBuf {
1890
1922
fn hash < H : Hasher > ( & self , h : & mut H ) {
@@ -3003,6 +3035,39 @@ impl cmp::PartialEq for Path {
3003
3035
}
3004
3036
}
3005
3037
3038
+ #[ stable( feature = "eq-str-for-path" , since = "CURRENT_RUSTC_VERSION" ) ]
3039
+ impl cmp:: PartialEq < str > for Path {
3040
+ #[ inline]
3041
+ fn eq ( & self , other : & str ) -> bool {
3042
+ let other: & OsStr = other. as_ref ( ) ;
3043
+ self == other
3044
+ }
3045
+ }
3046
+
3047
+ #[ stable( feature = "eq-str-for-path" , since = "CURRENT_RUSTC_VERSION" ) ]
3048
+ impl cmp:: PartialEq < Path > for str {
3049
+ #[ inline]
3050
+ fn eq ( & self , other : & Path ) -> bool {
3051
+ other == self
3052
+ }
3053
+ }
3054
+
3055
+ #[ stable( feature = "eq-str-for-path" , since = "CURRENT_RUSTC_VERSION" ) ]
3056
+ impl cmp:: PartialEq < String > for Path {
3057
+ #[ inline]
3058
+ fn eq ( & self , other : & String ) -> bool {
3059
+ self == & * other
3060
+ }
3061
+ }
3062
+
3063
+ #[ stable( feature = "eq-str-for-path" , since = "CURRENT_RUSTC_VERSION" ) ]
3064
+ impl cmp:: PartialEq < Path > for String {
3065
+ #[ inline]
3066
+ fn eq ( & self , other : & Path ) -> bool {
3067
+ other == self
3068
+ }
3069
+ }
3070
+
3006
3071
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
3007
3072
impl Hash for Path {
3008
3073
fn hash < H : Hasher > ( & self , h : & mut H ) {
0 commit comments