@@ -491,9 +491,9 @@ pub(super) fn check_opaque_for_inheriting_lifetimes<'tcx>(
491
491
}
492
492
493
493
struct ProhibitOpaqueVisitor < ' tcx > {
494
+ tcx : TyCtxt < ' tcx > ,
494
495
opaque_identity_ty : Ty < ' tcx > ,
495
496
generics : & ' tcx ty:: Generics ,
496
- tcx : TyCtxt < ' tcx > ,
497
497
selftys : Vec < ( Span , Option < String > ) > ,
498
498
}
499
499
@@ -1471,8 +1471,8 @@ fn opaque_type_cycle_error(tcx: TyCtxt<'_>, def_id: LocalDefId, span: Span) {
1471
1471
. filter_map ( |e| typeck_results. node_type_opt ( e. hir_id ) . map ( |t| ( e. span , t) ) )
1472
1472
. filter ( |( _, ty) | !matches ! ( ty. kind( ) , ty:: Never ) )
1473
1473
{
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 {
1476
1476
fn visit_ty ( & mut self , t : Ty < ' tcx > ) -> ControlFlow < Self :: BreakTy > {
1477
1477
match * t. kind ( ) {
1478
1478
ty:: Opaque ( def, _) => {
@@ -1483,7 +1483,7 @@ fn opaque_type_cycle_error(tcx: TyCtxt<'_>, def_id: LocalDefId, span: Span) {
1483
1483
}
1484
1484
}
1485
1485
}
1486
- let mut visitor = VisitTypes ( vec ! [ ] ) ;
1486
+ let mut visitor = OpaqueTypeCollector ( vec ! [ ] ) ;
1487
1487
ty. visit_with ( & mut visitor) ;
1488
1488
for def_id in visitor. 0 {
1489
1489
let ty_span = tcx. def_span ( def_id) ;
0 commit comments