@@ -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 ;
@@ -1712,6 +1712,11 @@ impl Visitor<'tcx> for EncodeContext<'tcx> {
1712
1712
intravisit:: walk_expr ( self , ex) ;
1713
1713
self . encode_info_for_expr ( ex) ;
1714
1714
}
1715
+ fn visit_anon_const ( & mut self , c : & ' tcx AnonConst ) {
1716
+ intravisit:: walk_anon_const ( self , c) ;
1717
+ let def_id = self . tcx . hir ( ) . local_def_id ( c. hir_id ) ;
1718
+ self . record ( def_id, EncodeContext :: encode_info_for_anon_const, def_id) ;
1719
+ }
1715
1720
fn visit_item ( & mut self , item : & ' tcx hir:: Item ) {
1716
1721
intravisit:: walk_item ( self , item) ;
1717
1722
let def_id = self . tcx . hir ( ) . local_def_id ( item. hir_id ) ;
@@ -1729,25 +1734,10 @@ impl Visitor<'tcx> for EncodeContext<'tcx> {
1729
1734
EncodeContext :: encode_info_for_foreign_item,
1730
1735
( def_id, ni) ) ;
1731
1736
}
1732
- fn visit_variant ( & mut self ,
1733
- v : & ' tcx hir:: Variant ,
1734
- g : & ' tcx hir:: Generics ,
1735
- id : hir:: HirId ) {
1736
- intravisit:: walk_variant ( self , v, g, id) ;
1737
-
1738
- if let Some ( ref discr) = v. disr_expr {
1739
- let def_id = self . tcx . hir ( ) . local_def_id ( discr. hir_id ) ;
1740
- self . record ( def_id, EncodeContext :: encode_info_for_anon_const, def_id) ;
1741
- }
1742
- }
1743
1737
fn visit_generics ( & mut self , generics : & ' tcx hir:: Generics ) {
1744
1738
intravisit:: walk_generics ( self , generics) ;
1745
1739
self . encode_info_for_generics ( generics) ;
1746
1740
}
1747
- fn visit_ty ( & mut self , ty : & ' tcx hir:: Ty ) {
1748
- intravisit:: walk_ty ( self , ty) ;
1749
- self . encode_info_for_ty ( ty) ;
1750
- }
1751
1741
fn visit_macro_def ( & mut self , macro_def : & ' tcx hir:: MacroDef ) {
1752
1742
let def_id = self . tcx . hir ( ) . local_def_id ( macro_def. hir_id ) ;
1753
1743
self . record ( def_id, EncodeContext :: encode_info_for_macro_def, macro_def) ;
@@ -1785,16 +1775,6 @@ impl EncodeContext<'tcx> {
1785
1775
}
1786
1776
}
1787
1777
1788
- fn encode_info_for_ty ( & mut self , ty : & hir:: Ty ) {
1789
- match ty. kind {
1790
- hir:: TyKind :: Array ( _, ref length) => {
1791
- let def_id = self . tcx . hir ( ) . local_def_id ( length. hir_id ) ;
1792
- self . record ( def_id, EncodeContext :: encode_info_for_anon_const, def_id) ;
1793
- }
1794
- _ => { }
1795
- }
1796
- }
1797
-
1798
1778
fn encode_info_for_expr ( & mut self , expr : & hir:: Expr ) {
1799
1779
match expr. kind {
1800
1780
hir:: ExprKind :: Closure ( ..) => {
0 commit comments