@@ -2068,6 +2068,38 @@ impl PartialEq for PathBuf {
2068
2068
}
2069
2069
}
2070
2070
2071
+ #[ stable( feature = "eq_str_for_path" , since = "CURRENT_RUSTC_VERSION" ) ]
2072
+ impl cmp:: PartialEq < str > for PathBuf {
2073
+ #[ inline]
2074
+ fn eq ( & self , other : & str ) -> bool {
2075
+ & * self == other
2076
+ }
2077
+ }
2078
+
2079
+ #[ stable( feature = "eq_str_for_path" , since = "CURRENT_RUSTC_VERSION" ) ]
2080
+ impl cmp:: PartialEq < PathBuf > for str {
2081
+ #[ inline]
2082
+ fn eq ( & self , other : & PathBuf ) -> bool {
2083
+ other == self
2084
+ }
2085
+ }
2086
+
2087
+ #[ stable( feature = "eq_str_for_path" , since = "CURRENT_RUSTC_VERSION" ) ]
2088
+ impl cmp:: PartialEq < String > for PathBuf {
2089
+ #[ inline]
2090
+ fn eq ( & self , other : & String ) -> bool {
2091
+ * * self == * * other
2092
+ }
2093
+ }
2094
+
2095
+ #[ stable( feature = "eq_str_for_path" , since = "CURRENT_RUSTC_VERSION" ) ]
2096
+ impl cmp:: PartialEq < PathBuf > for String {
2097
+ #[ inline]
2098
+ fn eq ( & self , other : & PathBuf ) -> bool {
2099
+ other == self
2100
+ }
2101
+ }
2102
+
2071
2103
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
2072
2104
impl Hash for PathBuf {
2073
2105
fn hash < H : Hasher > ( & self , h : & mut H ) {
@@ -3242,6 +3274,39 @@ impl PartialEq for Path {
3242
3274
}
3243
3275
}
3244
3276
3277
+ #[ stable( feature = "eq_str_for_path" , since = "CURRENT_RUSTC_VERSION" ) ]
3278
+ impl cmp:: PartialEq < str > for Path {
3279
+ #[ inline]
3280
+ fn eq ( & self , other : & str ) -> bool {
3281
+ let other: & OsStr = other. as_ref ( ) ;
3282
+ self == other
3283
+ }
3284
+ }
3285
+
3286
+ #[ stable( feature = "eq_str_for_path" , since = "CURRENT_RUSTC_VERSION" ) ]
3287
+ impl cmp:: PartialEq < Path > for str {
3288
+ #[ inline]
3289
+ fn eq ( & self , other : & Path ) -> bool {
3290
+ other == self
3291
+ }
3292
+ }
3293
+
3294
+ #[ stable( feature = "eq_str_for_path" , since = "CURRENT_RUSTC_VERSION" ) ]
3295
+ impl cmp:: PartialEq < String > for Path {
3296
+ #[ inline]
3297
+ fn eq ( & self , other : & String ) -> bool {
3298
+ self == & * other
3299
+ }
3300
+ }
3301
+
3302
+ #[ stable( feature = "eq_str_for_path" , since = "CURRENT_RUSTC_VERSION" ) ]
3303
+ impl cmp:: PartialEq < Path > for String {
3304
+ #[ inline]
3305
+ fn eq ( & self , other : & Path ) -> bool {
3306
+ other == self
3307
+ }
3308
+ }
3309
+
3245
3310
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
3246
3311
impl Hash for Path {
3247
3312
fn hash < H : Hasher > ( & self , h : & mut H ) {
0 commit comments