@@ -491,9 +491,9 @@ pub(super) fn check_opaque_for_inheriting_lifetimes<'tcx>(
491491 }
492492
493493 struct ProhibitOpaqueVisitor < ' tcx > {
494+ tcx : TyCtxt < ' tcx > ,
494495 opaque_identity_ty : Ty < ' tcx > ,
495496 generics : & ' tcx ty:: Generics ,
496- tcx : TyCtxt < ' tcx > ,
497497 selftys : Vec < ( Span , Option < String > ) > ,
498498 }
499499
@@ -1471,8 +1471,8 @@ fn opaque_type_cycle_error(tcx: TyCtxt<'_>, def_id: LocalDefId, span: Span) {
14711471 . filter_map ( |e| typeck_results. node_type_opt ( e. hir_id ) . map ( |t| ( e. span , t) ) )
14721472 . filter ( |( _, ty) | !matches ! ( ty. kind( ) , ty:: Never ) )
14731473 {
1474- struct VisitTypes ( Vec < DefId > ) ;
1475- impl < ' tcx > ty:: fold:: TypeVisitor < ' tcx > for VisitTypes {
1474+ struct OpaqueTypeCollector ( Vec < DefId > ) ;
1475+ impl < ' tcx > ty:: fold:: TypeVisitor < ' tcx > for OpaqueTypeCollector {
14761476 fn visit_ty ( & mut self , t : Ty < ' tcx > ) -> ControlFlow < Self :: BreakTy > {
14771477 match * t. kind ( ) {
14781478 ty:: Opaque ( def, _) => {
@@ -1483,7 +1483,7 @@ fn opaque_type_cycle_error(tcx: TyCtxt<'_>, def_id: LocalDefId, span: Span) {
14831483 }
14841484 }
14851485 }
1486- let mut visitor = VisitTypes ( vec ! [ ] ) ;
1486+ let mut visitor = OpaqueTypeCollector ( vec ! [ ] ) ;
14871487 ty. visit_with ( & mut visitor) ;
14881488 for def_id in visitor. 0 {
14891489 let ty_span = tcx. def_span ( def_id) ;
0 commit comments