@@ -51,7 +51,7 @@ struct MarkSymbolVisitor<'a, 'tcx: 'a> {
5151 tables : & ' a ty:: TypeckTables < ' tcx > ,
5252 live_symbols : Box < FxHashSet < ast:: NodeId > > ,
5353 struct_has_extern_repr : bool ,
54- ignore_non_const_paths : bool ,
54+ in_pat : bool ,
5555 inherited_pub_visibility : bool ,
5656 ignore_variant_stack : Vec < DefId > ,
5757}
@@ -75,10 +75,10 @@ impl<'a, 'tcx> MarkSymbolVisitor<'a, 'tcx> {
7575
7676 fn handle_definition ( & mut self , def : Def ) {
7777 match def {
78- Def :: Const ( _) | Def :: AssociatedConst ( ..) => {
78+ Def :: Const ( _) | Def :: AssociatedConst ( ..) | Def :: TyAlias ( _ ) => {
7979 self . check_def_id ( def. def_id ( ) ) ;
8080 }
81- _ if self . ignore_non_const_paths => ( ) ,
81+ _ if self . in_pat => ( ) ,
8282 Def :: PrimTy ( ..) | Def :: SelfTy ( ..) |
8383 Def :: Local ( ..) | Def :: Upvar ( ..) => { }
8484 Def :: Variant ( variant_id) | Def :: VariantCtor ( variant_id, ..) => {
@@ -289,9 +289,9 @@ impl<'a, 'tcx> Visitor<'tcx> for MarkSymbolVisitor<'a, 'tcx> {
289289 _ => ( )
290290 }
291291
292- self . ignore_non_const_paths = true ;
292+ self . in_pat = true ;
293293 intravisit:: walk_pat ( self , pat) ;
294- self . ignore_non_const_paths = false ;
294+ self . in_pat = false ;
295295 }
296296
297297 fn visit_path ( & mut self , path : & ' tcx hir:: Path , _: ast:: NodeId ) {
@@ -429,7 +429,7 @@ fn find_live<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
429429 tables : & ty:: TypeckTables :: empty ( None ) ,
430430 live_symbols : box FxHashSet ( ) ,
431431 struct_has_extern_repr : false ,
432- ignore_non_const_paths : false ,
432+ in_pat : false ,
433433 inherited_pub_visibility : false ,
434434 ignore_variant_stack : vec ! [ ] ,
435435 } ;
0 commit comments