File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -1816,12 +1816,9 @@ impl Rewrite for ast::FunctionRetTy {
18161816 }
18171817}
18181818
1819- fn is_empty_infer ( context : & RewriteContext , ty : & ast:: Ty ) -> bool {
1819+ fn is_empty_infer ( ty : & ast:: Ty , pat_span : Span ) -> bool {
18201820 match ty. node {
1821- ast:: TyKind :: Infer => {
1822- let original = context. snippet ( ty. span ) ;
1823- original != "_"
1824- }
1821+ ast:: TyKind :: Infer => ty. span . hi ( ) == pat_span. hi ( ) ,
18251822 _ => false ,
18261823 }
18271824}
@@ -1833,7 +1830,7 @@ impl Rewrite for ast::Arg {
18331830 . pat
18341831 . rewrite ( context, Shape :: legacy ( shape. width , shape. indent ) ) ?;
18351832
1836- if !is_empty_infer ( context , & * self . ty ) {
1833+ if !is_empty_infer ( & * self . ty , self . pat . span ) {
18371834 if context. config . space_before_colon ( ) {
18381835 result. push_str ( " " ) ;
18391836 }
You can’t perform that action at this time.
0 commit comments