File tree 1 file changed +15
-0
lines changed
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ mod diagnostic;
39
39
#[ unstable( feature = "proc_macro_diagnostic" , issue = "54140" ) ]
40
40
pub use diagnostic:: { Diagnostic , Level , MultiSpan } ;
41
41
42
+ use std:: cmp:: Ordering ;
42
43
use std:: ops:: { Bound , RangeBounds } ;
43
44
use std:: path:: PathBuf ;
44
45
use std:: str:: FromStr ;
@@ -420,6 +421,20 @@ impl !Send for LineColumn {}
420
421
#[ unstable( feature = "proc_macro_span" , issue = "54725" ) ]
421
422
impl !Sync for LineColumn { }
422
423
424
+ #[ unstable( feature = "proc_macro_span" , issue = "54725" ) ]
425
+ impl Ord for LineColumn {
426
+ fn cmp ( & self , other : & Self ) -> Ordering {
427
+ self . line . cmp ( & other. line ) . then ( self . column . cmp ( & other. column ) )
428
+ }
429
+ }
430
+
431
+ #[ unstable( feature = "proc_macro_span" , issue = "54725" ) ]
432
+ impl PartialOrd for LineColumn {
433
+ fn partial_cmp ( & self , other : & Self ) -> Option < Ordering > {
434
+ Some ( self . cmp ( other) )
435
+ }
436
+ }
437
+
423
438
/// The source file of a given `Span`.
424
439
#[ unstable( feature = "proc_macro_span" , issue = "54725" ) ]
425
440
#[ derive( Clone ) ]
You can’t perform that action at this time.
0 commit comments