@@ -14,7 +14,7 @@ use uuid::Uuid;
1414use crate :: block:: { BasicBlock , BlockArena , BlockId , reset_block_id_counter} ;
1515use crate :: block_rel:: { BlockIndexMaps , BlockRelationMap } ;
1616use crate :: file:: File ;
17- use crate :: meta:: { UnitMeta , UnitMetaBuilder } ;
17+ use crate :: meta:: { SourceFileMetadata , SourceLayoutIndex } ;
1818
1919/// Controls how files are ordered after parallel reading.
2020#[ derive( Debug , Clone , Copy , Default , PartialEq , Eq ) ]
@@ -182,7 +182,7 @@ impl<'tcx> CompileUnit<'tcx> {
182182
183183 /// Get the module metadata for this compilation unit.
184184 /// Contains package/module/file names and roots.
185- pub fn unit_meta ( & self ) -> & UnitMeta {
185+ pub fn unit_meta ( & self ) -> & SourceFileMetadata {
186186 & self . cc . unit_metas [ self . index ]
187187 }
188188
@@ -329,7 +329,7 @@ pub struct CompileCtxt<'tcx> {
329329 pub interner : InternPool ,
330330 pub files : Vec < File > ,
331331 /// Per-file metadata: package/module/file names and roots.
332- pub unit_metas : Vec < UnitMeta > ,
332+ pub unit_metas : Vec < SourceFileMetadata > ,
333333 /// Generic parse trees from language-specific parsers
334334 pub parse_trees : Vec < Box < dyn ParseTree > > ,
335335 pub hir_root_ids : RwLock < Vec < Option < HirId > > > ,
@@ -417,7 +417,7 @@ impl<'tcx> CompileCtxt<'tcx> {
417417 let ( parse_trees, mut metrics) = Self :: parse_files_with_metrics :: < L > ( & files) ?;
418418 metrics. file_read_seconds = file_read_seconds;
419419
420- // Build unit metadata using UnitMetaBuilder
420+ // Build unit metadata using SourceLayoutIndex
421421 let unit_metas = Self :: build_unit_metas :: < L > ( & files) ;
422422 let count = unit_metas. len ( ) ;
423423
@@ -477,7 +477,7 @@ impl<'tcx> CompileCtxt<'tcx> {
477477 let ( parse_trees, mut metrics) = Self :: parse_files_with_metrics :: < L > ( & files) ?;
478478 metrics. file_read_seconds = file_read_seconds;
479479
480- // Build unit metadata using UnitMetaBuilder
480+ // Build unit metadata using SourceLayoutIndex
481481 let unit_metas = Self :: build_unit_metas :: < L > ( & files) ;
482482 let count = unit_metas. len ( ) ;
483483
@@ -495,8 +495,8 @@ impl<'tcx> CompileCtxt<'tcx> {
495495 } )
496496 }
497497
498- /// Build unit metadata for all files using UnitMetaBuilder .
499- fn build_unit_metas < L : Language > ( files : & [ File ] ) -> Vec < UnitMeta > {
498+ /// Build unit metadata for all files using SourceLayoutIndex .
499+ fn build_unit_metas < L : Language > ( files : & [ File ] ) -> Vec < SourceFileMetadata > {
500500 if files. is_empty ( ) {
501501 return Vec :: new ( ) ;
502502 }
@@ -508,20 +508,20 @@ impl<'tcx> CompileCtxt<'tcx> {
508508 . collect ( ) ;
509509
510510 if file_paths. is_empty ( ) {
511- return vec ! [ UnitMeta :: default ( ) ; files. len( ) ] ;
511+ return vec ! [ SourceFileMetadata :: default ( ) ; files. len( ) ] ;
512512 }
513513
514514 // Build the detector (computes project root internally)
515- let builder = UnitMetaBuilder :: from_language :: < L > ( & file_paths) ;
515+ let meta_index = SourceLayoutIndex :: from_language :: < L > ( & file_paths) ;
516516
517517 // Generate metadata for each file
518- let mut metas: Vec < UnitMeta > = files
518+ let mut metas: Vec < SourceFileMetadata > = files
519519 . iter ( )
520520 . map ( |f| {
521521 if let Some ( path) = f. path ( ) {
522- builder . get_module_info ( std:: path:: Path :: new ( path) )
522+ meta_index . metadata_for ( std:: path:: Path :: new ( path) )
523523 } else {
524- UnitMeta :: default ( )
524+ SourceFileMetadata :: default ( )
525525 }
526526 } )
527527 . collect ( ) ;
0 commit comments