@@ -30,10 +30,11 @@ fn should_explore(tcx: TyCtxt<'_>, hir_id: hir::HirId) -> bool {
30
30
Some ( Node :: Item ( ..) ) |
31
31
Some ( Node :: ImplItem ( ..) ) |
32
32
Some ( Node :: ForeignItem ( ..) ) |
33
- Some ( Node :: TraitItem ( ..) ) =>
34
- true ,
35
- _ =>
36
- false
33
+ Some ( Node :: TraitItem ( ..) ) |
34
+ Some ( Node :: Variant ( ..) ) |
35
+ Some ( Node :: AnonConst ( ..) ) |
36
+ Some ( Node :: Pat ( ..) ) => true ,
37
+ _ => false
37
38
}
38
39
}
39
40
@@ -75,7 +76,7 @@ impl<'a, 'tcx> MarkSymbolVisitor<'a, 'tcx> {
75
76
self . check_def_id ( res. def_id ( ) ) ;
76
77
}
77
78
_ if self . in_pat => { } ,
78
- Res :: PrimTy ( ..) | Res :: SelfTy ( .. ) | Res :: SelfCtor ( ..) |
79
+ Res :: PrimTy ( ..) | Res :: SelfCtor ( ..) |
79
80
Res :: Local ( ..) => { }
80
81
Res :: Def ( DefKind :: Ctor ( CtorOf :: Variant , ..) , ctor_def_id) => {
81
82
let variant_id = self . tcx . parent ( ctor_def_id) . unwrap ( ) ;
@@ -92,6 +93,14 @@ impl<'a, 'tcx> MarkSymbolVisitor<'a, 'tcx> {
92
93
self . check_def_id ( variant_id) ;
93
94
}
94
95
}
96
+ Res :: SelfTy ( t, i) => {
97
+ if let Some ( t) = t {
98
+ self . check_def_id ( t) ;
99
+ }
100
+ if let Some ( i) = i {
101
+ self . check_def_id ( i) ;
102
+ }
103
+ }
95
104
Res :: ToolMod | Res :: NonMacroAttr ( ..) | Res :: Err => { }
96
105
_ => {
97
106
self . check_def_id ( res. def_id ( ) ) ;
@@ -271,7 +280,7 @@ impl<'a, 'tcx> Visitor<'tcx> for MarkSymbolVisitor<'a, 'tcx> {
271
280
let res = self . tables . qpath_res ( path, pat. hir_id ) ;
272
281
self . handle_field_pattern_match ( pat, res, fields) ;
273
282
}
274
- PatKind :: Path ( ref qpath @ hir :: QPath :: TypeRelative ( .. ) ) => {
283
+ PatKind :: Path ( ref qpath) => {
275
284
let res = self . tables . qpath_res ( qpath, pat. hir_id ) ;
276
285
self . handle_res ( res) ;
277
286
}
@@ -298,6 +307,11 @@ impl<'a, 'tcx> Visitor<'tcx> for MarkSymbolVisitor<'a, 'tcx> {
298
307
}
299
308
intravisit:: walk_ty ( self , ty) ;
300
309
}
310
+
311
+ fn visit_anon_const ( & mut self , c : & ' tcx hir:: AnonConst ) {
312
+ self . live_symbols . insert ( c. hir_id ) ;
313
+ intravisit:: walk_anon_const ( self , c) ;
314
+ }
301
315
}
302
316
303
317
fn has_allow_dead_code_or_lang_attr (
0 commit comments