@@ -2051,7 +2051,7 @@ impl<'a> IntoIterator for &'a Path {
2051
2051
fn into_iter ( self ) -> Iter < ' a > { self . iter ( ) }
2052
2052
}
2053
2053
2054
- macro_rules! impl_eq {
2054
+ macro_rules! impl_cmp {
2055
2055
( $lhs: ty, $rhs: ty) => {
2056
2056
#[ stable( feature = "partialeq_path" , since = "1.6.0" ) ]
2057
2057
impl <' a, ' b> PartialEq <$rhs> for $lhs {
@@ -2065,14 +2065,29 @@ macro_rules! impl_eq {
2065
2065
fn eq( & self , other: & $lhs) -> bool { <Path as PartialEq >:: eq( self , other) }
2066
2066
}
2067
2067
2068
+ #[ stable( feature = "cmp_path" , since = "1.8.0" ) ]
2069
+ impl <' a, ' b> PartialOrd <$rhs> for $lhs {
2070
+ #[ inline]
2071
+ fn partial_cmp( & self , other: & $rhs) -> Option <cmp:: Ordering > {
2072
+ <Path as PartialOrd >:: partial_cmp( self , other)
2073
+ }
2074
+ }
2075
+
2076
+ #[ stable( feature = "cmp_path" , since = "1.8.0" ) ]
2077
+ impl <' a, ' b> PartialOrd <$lhs> for $rhs {
2078
+ #[ inline]
2079
+ fn partial_cmp( & self , other: & $lhs) -> Option <cmp:: Ordering > {
2080
+ <Path as PartialOrd >:: partial_cmp( self , other)
2081
+ }
2082
+ }
2068
2083
}
2069
2084
}
2070
2085
2071
- impl_eq ! ( PathBuf , Path ) ;
2072
- impl_eq ! ( PathBuf , & ' a Path ) ;
2073
- impl_eq ! ( Cow <' a, Path >, Path ) ;
2074
- impl_eq ! ( Cow <' a, Path >, & ' b Path ) ;
2075
- impl_eq ! ( Cow <' a, Path >, PathBuf ) ;
2086
+ impl_cmp ! ( PathBuf , Path ) ;
2087
+ impl_cmp ! ( PathBuf , & ' a Path ) ;
2088
+ impl_cmp ! ( Cow <' a, Path >, Path ) ;
2089
+ impl_cmp ! ( Cow <' a, Path >, & ' b Path ) ;
2090
+ impl_cmp ! ( Cow <' a, Path >, PathBuf ) ;
2076
2091
2077
2092
#[ stable( since = "1.7.0" , feature = "strip_prefix" ) ]
2078
2093
impl fmt:: Display for StripPrefixError {
0 commit comments