@@ -315,7 +315,7 @@ impl<'a, 'tcx, 'rcx> AutoTraitFinder<'a, 'tcx, 'rcx> {
315315
316316 // Due to the way projections are handled by SelectionContext, we need to run
317317 // evaluate_predicates twice: once on the original param env, and once on the result of
318- // the first evaluate_predicates call
318+ // the first evaluate_predicates call.
319319 //
320320 // The problem is this: most of rustc, including SelectionContext and traits::project,
321321 // are designed to work with a concrete usage of a type (e.g. Vec<u8>
@@ -338,7 +338,7 @@ impl<'a, 'tcx, 'rcx> AutoTraitFinder<'a, 'tcx, 'rcx> {
338338 // We fix the first assumption by manually clearing out all of the InferCtxt's caches
339339 // in between calls to SelectionContext.select. This allows us to keep all of the
340340 // intermediate types we create bound to the 'tcx lifetime, rather than needing to lift
341- // them between calls
341+ // them between calls.
342342 //
343343 // We fix the second assumption by reprocessing the result of our first call to
344344 // evaluate_predicates. Using the example of '<T as SomeTrait>::SomeItem = K', our first
@@ -457,13 +457,8 @@ impl<'a, 'tcx, 'rcx> AutoTraitFinder<'a, 'tcx, 'rcx> {
457457 infcx. freshen ( p)
458458 }
459459
460- fn evaluate_nested_obligations <
461- ' b ,
462- ' c ,
463- ' d ,
464- ' cx ,
465- T : Iterator < Item = Obligation < ' cx , ty:: Predicate < ' cx > > > ,
466- > (
460+ fn evaluate_nested_obligations < ' b , ' c , ' d , ' cx ,
461+ T : Iterator < Item = Obligation < ' cx , ty:: Predicate < ' cx > > > > (
467462 & self ,
468463 ty : ty:: Ty ,
469464 nested : T ,
@@ -732,8 +727,8 @@ impl<'a, 'tcx, 'rcx> AutoTraitFinder<'a, 'tcx, 'rcx> {
732727 }
733728 }
734729
735- // This is very simiiar to handle_lifetimes. Instead of matching ty::Region's to ty::Region's,
736- // however , we match ty::RegionVid's to ty::Region's
730+ // This is very similar to handle_lifetimes. However, instead of matching ty::Region's
731+ // to each other , we match ty::RegionVid's to ty::Region's
737732 fn map_vid_to_region < ' cx > (
738733 & self ,
739734 regions : & RegionConstraintData < ' cx > ,
@@ -843,7 +838,7 @@ impl<'a, 'tcx, 'rcx> AutoTraitFinder<'a, 'tcx, 'rcx> {
843838 // with determining if a given set up constraints/predicates *are* met, given some
844839 // starting conditions (e.g. user-provided code). For this reason, it's easier
845840 // to perform the calculations we need on our own, rather than trying to make
846- // existing inference/solver code do what we want
841+ // existing inference/solver code do what we want.
847842 fn handle_lifetimes < ' cx > (
848843 & self ,
849844 regions : & RegionConstraintData < ' cx > ,
@@ -852,8 +847,7 @@ impl<'a, 'tcx, 'rcx> AutoTraitFinder<'a, 'tcx, 'rcx> {
852847 // Our goal is to 'flatten' the list of constraints by eliminating
853848 // all intermediate RegionVids. At the end, all constraints should
854849 // be between Regions (aka region variables). This gives us the information
855- // we need to create the Generics
856- //
850+ // we need to create the Generics.
857851 let mut finished = FxHashMap ( ) ;
858852
859853 let mut vid_map: FxHashMap < RegionTarget , RegionDeps > = FxHashMap ( ) ;
@@ -1021,7 +1015,7 @@ impl<'a, 'tcx, 'rcx> AutoTraitFinder<'a, 'tcx, 'rcx> {
10211015 ty_to_fn : FxHashMap < Type , ( Option < PolyTrait > , Option < Type > ) > ,
10221016 lifetime_to_bounds : FxHashMap < Lifetime , FxHashSet < Lifetime > > ,
10231017 ) -> Vec < WherePredicate > {
1024- let final_predicates = ty_to_bounds
1018+ ty_to_bounds
10251019 . into_iter ( )
10261020 . flat_map ( |( ty, mut bounds) | {
10271021 if let Some ( data) = ty_to_fn. get ( & ty) {
@@ -1096,9 +1090,7 @@ impl<'a, 'tcx, 'rcx> AutoTraitFinder<'a, 'tcx, 'rcx> {
10961090 bounds : bounds. into_iter ( ) . collect ( ) ,
10971091 } ) ,
10981092 )
1099- . collect ( ) ;
1100-
1101- final_predicates
1093+ . collect ( )
11021094 }
11031095
11041096 // Converts the calculated ParamEnv and lifetime information to a clean::Generics, suitable for
@@ -1380,7 +1372,7 @@ impl<'a, 'tcx, 'rcx> AutoTraitFinder<'a, 'tcx, 'rcx> {
13801372 }
13811373
13821374 // This is an ugly hack, but it's the simplest way to handle synthetic impls without greatly
1383- // refactorying either librustdoc or librustc. In particular, allowing new DefIds to be
1375+ // refactoring either librustdoc or librustc. In particular, allowing new DefIds to be
13841376 // registered after the AST is constructed would require storing the defid mapping in a
13851377 // RefCell, decreasing the performance for normal compilation for very little gain.
13861378 //
0 commit comments