File tree Expand file tree Collapse file tree 1 file changed +39
-2
lines changed
compiler/rustc_metadata/src/rmeta Expand file tree Collapse file tree 1 file changed +39
-2
lines changed Original file line number Diff line number Diff line change @@ -941,6 +941,41 @@ fn should_encode_type(def_kind: DefKind) -> bool {
941
941
}
942
942
}
943
943
944
+ fn should_encode_fn_sig ( def_kind : DefKind ) -> bool {
945
+ match def_kind {
946
+ DefKind :: Variant
947
+ | DefKind :: TraitAlias
948
+ | DefKind :: Fn
949
+ | DefKind :: Ctor ( ..)
950
+ | DefKind :: AssocFn => true ,
951
+ DefKind :: Struct
952
+ | DefKind :: Union
953
+ | DefKind :: Enum
954
+ | DefKind :: Trait
955
+ | DefKind :: TyAlias
956
+ | DefKind :: ForeignTy
957
+ | DefKind :: AssocTy
958
+ | DefKind :: Const
959
+ | DefKind :: Static
960
+ | DefKind :: AssocConst
961
+ | DefKind :: AnonConst
962
+ | DefKind :: OpaqueTy
963
+ | DefKind :: Impl
964
+ | DefKind :: Closure
965
+ | DefKind :: Generator
966
+ | DefKind :: Mod
967
+ | DefKind :: Field
968
+ | DefKind :: ForeignMod
969
+ | DefKind :: TyParam
970
+ | DefKind :: ConstParam
971
+ | DefKind :: Macro ( ..)
972
+ | DefKind :: Use
973
+ | DefKind :: LifetimeParam
974
+ | DefKind :: GlobalAsm
975
+ | DefKind :: ExternCrate => false ,
976
+ }
977
+ }
978
+
944
979
impl EncodeContext < ' a , ' tcx > {
945
980
fn encode_def_ids ( & mut self ) {
946
981
if self . is_proc_macro {
@@ -990,8 +1025,10 @@ impl EncodeContext<'a, 'tcx> {
990
1025
record ! ( self . tables. ty[ def_id] <- ty) ;
991
1026
}
992
1027
}
993
- if let Ok ( sig) = tcx. try_fn_sig ( def_id) {
994
- record ! ( self . tables. fn_sig[ def_id] <- sig) ;
1028
+ if should_encode_fn_sig ( def_kind) {
1029
+ if let Ok ( sig) = tcx. try_fn_sig ( def_id) {
1030
+ record ! ( self . tables. fn_sig[ def_id] <- sig) ;
1031
+ }
995
1032
}
996
1033
self . encode_explicit_item_bounds ( def_id) ;
997
1034
}
You can’t perform that action at this time.
0 commit comments