@@ -47,7 +47,8 @@ pub struct Location<'a> {
4747}
4848
4949#[ stable( feature = "panic_hooks" , since = "1.10.0" ) ]
50- impl PartialEq for Location < ' _ > {
50+ #[ rustc_const_unstable( feature = "const_cmp" , issue = "143800" ) ]
51+ const impl PartialEq for Location < ' _ > {
5152 fn eq ( & self , other : & Self ) -> bool {
5253 // Compare col / line first as they're cheaper to compare and more likely to differ,
5354 // while not impacting the result.
@@ -56,20 +57,23 @@ impl PartialEq for Location<'_> {
5657}
5758
5859#[ stable( feature = "panic_hooks" , since = "1.10.0" ) ]
59- impl Eq for Location < ' _ > { }
60+ #[ rustc_const_unstable( feature = "const_cmp" , issue = "143800" ) ]
61+ const impl Eq for Location < ' _ > { }
6062
6163#[ stable( feature = "panic_hooks" , since = "1.10.0" ) ]
62- impl Ord for Location < ' _ > {
64+ #[ rustc_const_unstable( feature = "const_cmp" , issue = "143800" ) ]
65+ const impl Ord for Location < ' _ > {
6366 fn cmp ( & self , other : & Self ) -> Ordering {
6467 self . file ( )
6568 . cmp ( other. file ( ) )
66- . then_with ( || self . line . cmp ( & other. line ) )
67- . then_with ( || self . col . cmp ( & other. col ) )
69+ . then_with ( const || self . line . cmp ( & other. line ) )
70+ . then_with ( const || self . col . cmp ( & other. col ) )
6871 }
6972}
7073
7174#[ stable( feature = "panic_hooks" , since = "1.10.0" ) ]
72- impl PartialOrd for Location < ' _ > {
75+ #[ rustc_const_unstable( feature = "const_cmp" , issue = "143800" ) ]
76+ const impl PartialOrd for Location < ' _ > {
7377 fn partial_cmp ( & self , other : & Self ) -> Option < Ordering > {
7478 Some ( self . cmp ( other) )
7579 }
0 commit comments