File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
compiler/rustc_metadata/src/rmeta Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -1013,8 +1013,15 @@ impl EncodeContext<'a, 'tcx> {
1013
1013
self . encode_inferred_outlives ( def_id) ;
1014
1014
1015
1015
// This should be kept in sync with `PrefetchVisitor.visit_trait_item`.
1016
- self . encode_optimized_mir ( def_id. expect_local ( ) ) ;
1017
- self . encode_promoted_mir ( def_id. expect_local ( ) ) ;
1016
+ match trait_item. kind {
1017
+ ty:: AssocKind :: Type => { }
1018
+ ty:: AssocKind :: Const | ty:: AssocKind :: Fn => {
1019
+ if self . tcx . mir_keys ( LOCAL_CRATE ) . contains ( & def_id. expect_local ( ) ) {
1020
+ self . encode_optimized_mir ( def_id. expect_local ( ) ) ;
1021
+ self . encode_promoted_mir ( def_id. expect_local ( ) ) ;
1022
+ }
1023
+ }
1024
+ }
1018
1025
}
1019
1026
1020
1027
fn metadata_output_only ( & self ) -> bool {
You can’t perform that action at this time.
0 commit comments