File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ mod diagnostic;
3939#[ unstable( feature = "proc_macro_diagnostic" , issue = "54140" ) ]
4040pub use diagnostic:: { Diagnostic , Level , MultiSpan } ;
4141
42+ use std:: cmp:: Ordering ;
4243use std:: ops:: { Bound , RangeBounds } ;
4344use std:: path:: PathBuf ;
4445use std:: str:: FromStr ;
@@ -420,6 +421,20 @@ impl !Send for LineColumn {}
420421#[ unstable( feature = "proc_macro_span" , issue = "54725" ) ]
421422impl !Sync for LineColumn { }
422423
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+
423438/// The source file of a given `Span`.
424439#[ unstable( feature = "proc_macro_span" , issue = "54725" ) ]
425440#[ derive( Clone ) ]
You can’t perform that action at this time.
0 commit comments