@@ -436,7 +436,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
436436 assert ! (
437437 last_pos <= position,
438438 "make sure that the calls to `lazy*` \
439- are in the same order as the metadata fields",
439+ are in the same order as the metadata fields",
440440 ) ;
441441 position. get ( ) - last_pos. get ( )
442442 }
@@ -603,6 +603,13 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
603603 adapted. encode ( & mut self . opaque )
604604 }
605605
606+ fn dont_encode_source_map (
607+ & mut self ,
608+ ) -> LazyTable < u32 , Option < LazyValue < rustc_span:: SourceFile > > > {
609+ let adapted = TableBuilder :: default ( ) ;
610+ adapted. encode ( & mut self . opaque )
611+ }
612+
606613 fn encode_crate_root ( & mut self ) -> LazyValue < CrateRoot > {
607614 let tcx = self . tcx ;
608615 let mut stats: Vec < ( & ' static str , usize ) > = Vec :: with_capacity ( 32 ) ;
@@ -708,7 +715,11 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
708715
709716 // Encode source_map. This needs to be done last, because encoding `Span`s tells us which
710717 // `SourceFiles` we actually need to encode.
711- let source_map = stat ! ( "source-map" , || self . encode_source_map( ) ) ;
718+ let source_map = if tcx. sess . is_split_rmeta_enabled ( ) {
719+ stat ! ( "source-map" , || self . dont_encode_source_map( ) )
720+ } else {
721+ stat ! ( "source-map" , || self . encode_source_map( ) )
722+ } ;
712723 let target_modifiers = stat ! ( "target-modifiers" , || self . encode_target_modifiers( ) ) ;
713724
714725 let root = stat ! ( "final" , || {
@@ -1706,7 +1717,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
17061717
17071718 record_array ! ( self . tables. module_children_non_reexports[ def_id] <-
17081719 module_children. iter( ) . filter( |child| child. reexport_chain. is_empty( ) )
1709- . map( |child| child. res. def_id( ) . index) ) ;
1720+ . map( |child| child. res. def_id( ) . index) ) ;
17101721
17111722 record_defaulted_array ! ( self . tables. module_children_reexports[ def_id] <-
17121723 module_children. iter( ) . filter( |child| !child. reexport_chain. is_empty( ) ) ) ;
@@ -1755,7 +1766,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
17551766 if matches ! ( rpitit_info, ty:: ImplTraitInTraitData :: Trait { .. } ) {
17561767 record_array ! (
17571768 self . tables. assumed_wf_types_for_rpitit[ def_id]
1758- <- self . tcx. assumed_wf_types_for_rpitit( def_id)
1769+ <- self . tcx. assumed_wf_types_for_rpitit( def_id)
17591770 ) ;
17601771 self . encode_precise_capturing_args ( def_id) ;
17611772 }
@@ -1838,7 +1849,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
18381849 for & local_def_id in tcx. mir_keys ( ( ) ) {
18391850 if let DefKind :: AssocFn | DefKind :: Fn = tcx. def_kind ( local_def_id) {
18401851 record_array ! ( self . tables. deduced_param_attrs[ local_def_id. to_def_id( ) ] <-
1841- self . tcx. deduced_param_attrs( local_def_id. to_def_id( ) ) ) ;
1852+ self . tcx. deduced_param_attrs( local_def_id. to_def_id( ) ) ) ;
18421853 }
18431854 }
18441855 }
0 commit comments