File tree 1 file changed +3
-6
lines changed
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 {
1816
1816
}
1817
1817
}
1818
1818
1819
- fn is_empty_infer ( context : & RewriteContext , ty : & ast:: Ty ) -> bool {
1819
+ fn is_empty_infer ( ty : & ast:: Ty , pat_span : Span ) -> bool {
1820
1820
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 ( ) ,
1825
1822
_ => false ,
1826
1823
}
1827
1824
}
@@ -1833,7 +1830,7 @@ impl Rewrite for ast::Arg {
1833
1830
. pat
1834
1831
. rewrite ( context, Shape :: legacy ( shape. width , shape. indent ) ) ?;
1835
1832
1836
- if !is_empty_infer ( context , & * self . ty ) {
1833
+ if !is_empty_infer ( & * self . ty , self . pat . span ) {
1837
1834
if context. config . space_before_colon ( ) {
1838
1835
result. push_str ( " " ) ;
1839
1836
}
You can’t perform that action at this time.
0 commit comments