@@ -563,6 +563,8 @@ 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
+ // FIXME(precise_capturing): Should implement formatting before stabilization.
567
+ ast:: GenericBound :: Use ( ..) => None ,
566
568
}
567
569
}
568
570
}
@@ -843,11 +845,7 @@ impl Rewrite for ast::Ty {
843
845
rewrite_macro ( mac, None , context, shape, MacroPosition :: Expression )
844
846
}
845
847
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
- }
848
+ ast:: TyKind :: ImplTrait ( _, ref it) => {
851
849
// Empty trait is not a parser error.
852
850
if it. is_empty ( ) {
853
851
return Some ( "impl" . to_owned ( ) ) ;
@@ -932,6 +930,8 @@ fn is_generic_bounds_in_order(generic_bounds: &[ast::GenericBound]) -> bool {
932
930
let is_trait = |b : & ast:: GenericBound | match b {
933
931
ast:: GenericBound :: Outlives ( ..) => false ,
934
932
ast:: GenericBound :: Trait ( ..) => true ,
933
+ // FIXME(precise_capturing): This ordering fn should be reworked.
934
+ ast:: GenericBound :: Use ( ..) => false ,
935
935
} ;
936
936
let is_lifetime = |b : & ast:: GenericBound | !is_trait ( b) ;
937
937
let last_trait_index = generic_bounds. iter ( ) . rposition ( is_trait) ;
@@ -966,6 +966,8 @@ fn join_bounds_inner(
966
966
let is_bound_extendable = |s : & str , b : & ast:: GenericBound | match b {
967
967
ast:: GenericBound :: Outlives ( ..) => true ,
968
968
ast:: GenericBound :: Trait ( ..) => last_line_extendable ( s) ,
969
+ // FIXME(precise_capturing): This ordering fn should be reworked.
970
+ ast:: GenericBound :: Use ( ..) => true ,
969
971
} ;
970
972
971
973
// Whether a GenericBound item is a PathSegment segment that includes internal array
@@ -1110,8 +1112,7 @@ fn join_bounds_inner(
1110
1112
1111
1113
pub ( crate ) fn opaque_ty ( ty : & Option < ptr:: P < ast:: Ty > > ) -> Option < & ast:: GenericBounds > {
1112
1114
ty. as_ref ( ) . and_then ( |t| match & t. kind {
1113
- // FIXME(precise_capturing): Implement support here
1114
- ast:: TyKind :: ImplTrait ( _, bounds, _) => Some ( bounds) ,
1115
+ ast:: TyKind :: ImplTrait ( _, bounds) => Some ( bounds) ,
1115
1116
_ => None ,
1116
1117
} )
1117
1118
}
0 commit comments