@@ -563,6 +563,7 @@ impl Rewrite for ast::GenericBound {
563
563
. map ( |s| if has_paren { format ! ( "({})" , s) } else { s } )
564
564
}
565
565
ast:: GenericBound :: Outlives ( ref lifetime) => lifetime. rewrite ( context, shape) ,
566
+ ast:: GenericBound :: Use ( ..) => None ,
566
567
}
567
568
}
568
569
}
@@ -843,11 +844,7 @@ impl Rewrite for ast::Ty {
843
844
rewrite_macro ( mac, None , context, shape, MacroPosition :: Expression )
844
845
}
845
846
ast:: TyKind :: ImplicitSelf => Some ( String :: from ( "" ) ) ,
846
- ast:: TyKind :: ImplTrait ( _, ref it, ref captures) => {
847
- // FIXME(precise_capturing): Implement formatting.
848
- if captures. is_some ( ) {
849
- return None ;
850
- }
847
+ ast:: TyKind :: ImplTrait ( _, ref it) => {
851
848
// Empty trait is not a parser error.
852
849
if it. is_empty ( ) {
853
850
return Some ( "impl" . to_owned ( ) ) ;
@@ -930,7 +927,7 @@ fn rewrite_bare_fn(
930
927
931
928
fn is_generic_bounds_in_order ( generic_bounds : & [ ast:: GenericBound ] ) -> bool {
932
929
let is_trait = |b : & ast:: GenericBound | match b {
933
- ast:: GenericBound :: Outlives ( ..) => false ,
930
+ ast:: GenericBound :: Outlives ( ..) | ast :: GenericBound :: Use ( .. ) => false ,
934
931
ast:: GenericBound :: Trait ( ..) => true ,
935
932
} ;
936
933
let is_lifetime = |b : & ast:: GenericBound | !is_trait ( b) ;
@@ -964,7 +961,7 @@ fn join_bounds_inner(
964
961
965
962
let generic_bounds_in_order = is_generic_bounds_in_order ( items) ;
966
963
let is_bound_extendable = |s : & str , b : & ast:: GenericBound | match b {
967
- ast:: GenericBound :: Outlives ( ..) => true ,
964
+ ast:: GenericBound :: Outlives ( ..) | ast :: GenericBound :: Use ( .. ) => true ,
968
965
ast:: GenericBound :: Trait ( ..) => last_line_extendable ( s) ,
969
966
} ;
970
967
@@ -1110,8 +1107,7 @@ fn join_bounds_inner(
1110
1107
1111
1108
pub ( crate ) fn opaque_ty ( ty : & Option < ptr:: P < ast:: Ty > > ) -> Option < & ast:: GenericBounds > {
1112
1109
ty. as_ref ( ) . and_then ( |t| match & t. kind {
1113
- // FIXME(precise_capturing): Implement support here
1114
- ast:: TyKind :: ImplTrait ( _, bounds, _) => Some ( bounds) ,
1110
+ ast:: TyKind :: ImplTrait ( _, bounds) => Some ( bounds) ,
1115
1111
_ => None ,
1116
1112
} )
1117
1113
}
0 commit comments