@@ -23,6 +23,7 @@ use crate::expr::{
2323use crate :: lists:: { definitive_tactic, itemize_list, write_list, ListFormatting , Separator } ;
2424use crate :: macros:: { rewrite_macro, MacroPosition } ;
2525use crate :: overflow;
26+ use crate :: reorder:: compare_as_versions;
2627use crate :: rewrite:: { Rewrite , RewriteContext } ;
2728use crate :: shape:: { Indent , Shape } ;
2829use crate :: source_map:: { LineRangeUtils , SpanUtils } ;
@@ -701,10 +702,10 @@ impl<'a> FmtVisitor<'a> {
701702 ( TyAlias ( _, _, _, ref lty) , TyAlias ( _, _, _, ref rty) )
702703 if both_type ( lty, rty) || both_opaque ( lty, rty) =>
703704 {
704- a. ident . as_str ( ) . cmp ( & b. ident . as_str ( ) )
705+ compare_as_versions ( & a. ident . as_str ( ) , & b. ident . as_str ( ) )
705706 }
706707 ( Const ( ..) , Const ( ..) ) | ( MacCall ( ..) , MacCall ( ..) ) => {
707- a. ident . as_str ( ) . cmp ( & b. ident . as_str ( ) )
708+ compare_as_versions ( & a. ident . as_str ( ) , & b. ident . as_str ( ) )
708709 }
709710 ( Fn ( ..) , Fn ( ..) ) => a. span . lo ( ) . cmp ( & b. span . lo ( ) ) ,
710711 ( TyAlias ( _, _, _, ref ty) , _) if is_type ( ty) => Ordering :: Less ,
0 commit comments