@@ -378,13 +378,16 @@ impl<'tcx> MarkSymbolVisitor<'tcx> {
378
378
}
379
379
hir:: ItemKind :: ForeignMod { .. } => { }
380
380
hir:: ItemKind :: Trait ( ..) => {
381
- // mark dependent traits live
382
381
for impl_def_id in self . tcx . all_impls ( item. owner_id . to_def_id ( ) ) {
383
382
if let Some ( local_def_id) = impl_def_id. as_local ( )
384
383
&& let ItemKind :: Impl ( impl_ref) =
385
384
self . tcx . hir ( ) . expect_item ( local_def_id) . kind
386
385
{
386
+ // skip items
387
+ // mark dependent traits live
387
388
intravisit:: walk_generics ( self , impl_ref. generics ) ;
389
+ // mark dependent parameters live
390
+ intravisit:: walk_path ( self , impl_ref. of_trait . unwrap ( ) . path ) ;
388
391
}
389
392
}
390
393
@@ -396,15 +399,16 @@ impl<'tcx> MarkSymbolVisitor<'tcx> {
396
399
// mark corresponing ImplTerm live
397
400
let def_id = trait_item. owner_id . to_def_id ( ) ;
398
401
if let Some ( trait_def_id) = self . tcx . trait_of_item ( def_id) {
399
- // for assoc fn without self, mark the trait live
402
+ // mark the trait live
400
403
self . check_def_id ( trait_def_id) ;
401
404
402
405
for impl_def in self . tcx . all_impls ( trait_def_id) {
403
406
if let Some ( impl_def_id) = impl_def. as_local ( )
404
407
&& let ItemKind :: Impl ( impl_ref) =
405
408
self . tcx . hir ( ) . expect_item ( impl_def_id) . kind
406
409
{
407
- self . check_def_id ( impl_def) ;
410
+ // mark self_ty live
411
+ intravisit:: walk_ty ( self , impl_ref. self_ty ) ;
408
412
for impl_item in impl_ref. items {
409
413
if Some ( def_id) == impl_item. trait_item_def_id {
410
414
self . check_def_id ( impl_item. id . owner_id . to_def_id ( ) ) ;
0 commit comments