@@ -5,7 +5,7 @@ use rustc::middle::cstore::{LinkagePreference, NativeLibrary,
5
5
EncodedMetadata , ForeignModule } ;
6
6
use rustc:: hir:: def:: CtorKind ;
7
7
use rustc:: hir:: def_id:: { CrateNum , CRATE_DEF_INDEX , DefIndex , DefId , LocalDefId , LOCAL_CRATE } ;
8
- use rustc:: hir:: GenericParamKind ;
8
+ use rustc:: hir:: { GenericParamKind , AnonConst } ;
9
9
use rustc:: hir:: map:: definitions:: DefPathTable ;
10
10
use rustc_data_structures:: fingerprint:: Fingerprint ;
11
11
use rustc_index:: vec:: IndexVec ;
@@ -1711,6 +1711,11 @@ impl Visitor<'tcx> for EncodeContext<'tcx> {
1711
1711
intravisit:: walk_expr ( self , ex) ;
1712
1712
self . encode_info_for_expr ( ex) ;
1713
1713
}
1714
+ fn visit_anon_const ( & mut self , c : & ' tcx AnonConst ) {
1715
+ intravisit:: walk_anon_const ( self , c) ;
1716
+ let def_id = self . tcx . hir ( ) . local_def_id ( c. hir_id ) ;
1717
+ self . record ( def_id, EncodeContext :: encode_info_for_anon_const, def_id) ;
1718
+ }
1714
1719
fn visit_item ( & mut self , item : & ' tcx hir:: Item ) {
1715
1720
intravisit:: walk_item ( self , item) ;
1716
1721
let def_id = self . tcx . hir ( ) . local_def_id ( item. hir_id ) ;
@@ -1728,25 +1733,10 @@ impl Visitor<'tcx> for EncodeContext<'tcx> {
1728
1733
EncodeContext :: encode_info_for_foreign_item,
1729
1734
( def_id, ni) ) ;
1730
1735
}
1731
- fn visit_variant ( & mut self ,
1732
- v : & ' tcx hir:: Variant ,
1733
- g : & ' tcx hir:: Generics ,
1734
- id : hir:: HirId ) {
1735
- intravisit:: walk_variant ( self , v, g, id) ;
1736
-
1737
- if let Some ( ref discr) = v. disr_expr {
1738
- let def_id = self . tcx . hir ( ) . local_def_id ( discr. hir_id ) ;
1739
- self . record ( def_id, EncodeContext :: encode_info_for_anon_const, def_id) ;
1740
- }
1741
- }
1742
1736
fn visit_generics ( & mut self , generics : & ' tcx hir:: Generics ) {
1743
1737
intravisit:: walk_generics ( self , generics) ;
1744
1738
self . encode_info_for_generics ( generics) ;
1745
1739
}
1746
- fn visit_ty ( & mut self , ty : & ' tcx hir:: Ty ) {
1747
- intravisit:: walk_ty ( self , ty) ;
1748
- self . encode_info_for_ty ( ty) ;
1749
- }
1750
1740
fn visit_macro_def ( & mut self , macro_def : & ' tcx hir:: MacroDef ) {
1751
1741
let def_id = self . tcx . hir ( ) . local_def_id ( macro_def. hir_id ) ;
1752
1742
self . record ( def_id, EncodeContext :: encode_info_for_macro_def, macro_def) ;
@@ -1784,16 +1774,6 @@ impl EncodeContext<'tcx> {
1784
1774
}
1785
1775
}
1786
1776
1787
- fn encode_info_for_ty ( & mut self , ty : & hir:: Ty ) {
1788
- match ty. kind {
1789
- hir:: TyKind :: Array ( _, ref length) => {
1790
- let def_id = self . tcx . hir ( ) . local_def_id ( length. hir_id ) ;
1791
- self . record ( def_id, EncodeContext :: encode_info_for_anon_const, def_id) ;
1792
- }
1793
- _ => { }
1794
- }
1795
- }
1796
-
1797
1777
fn encode_info_for_expr ( & mut self , expr : & hir:: Expr ) {
1798
1778
match expr. kind {
1799
1779
hir:: ExprKind :: Closure ( ..) => {
0 commit comments