@@ -77,7 +77,7 @@ use rustc_session::lint::builtin::PRIVATE_MACRO_USE;
7777use rustc_span:: hygiene:: { ExpnId , LocalExpnId , MacroKind , SyntaxContext , Transparency } ;
7878use rustc_span:: { DUMMY_SP , Ident , Span , Symbol , kw, sym} ;
7979use smallvec:: { SmallVec , smallvec} ;
80- use tracing:: { debug, instrument } ;
80+ use tracing:: debug;
8181
8282type Res = def:: Res < NodeId > ;
8383
@@ -1125,7 +1125,7 @@ struct ExternPreludeEntry<'ra> {
11251125 CacheCell < (
11261126 PendingDecl < ' ra > ,
11271127 /* finalized */ bool ,
1128- /* virtual flag (namespaced crate) */ bool ,
1128+ /* open flag (namespaced crate) */ bool ,
11291129 ) > ,
11301130 > ,
11311131}
@@ -1142,7 +1142,7 @@ impl ExternPreludeEntry<'_> {
11421142 }
11431143 }
11441144
1145- fn virtual_flag ( ) -> Self {
1145+ fn open_flag ( ) -> Self {
11461146 ExternPreludeEntry {
11471147 item_decl : None ,
11481148 flag_decl : Some ( CacheCell :: new ( ( PendingDecl :: Pending , false , true ) ) ) ,
@@ -2304,7 +2304,6 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
23042304 } )
23052305 }
23062306
2307- #[ instrument( skip( self ) , level = "debug" ) ]
23082307 fn extern_prelude_get_flag (
23092308 & self ,
23102309 ident : IdentKey ,
@@ -2313,11 +2312,10 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
23132312 ) -> Option < Decl < ' ra > > {
23142313 let entry = self . extern_prelude . get ( & ident) ;
23152314 entry. and_then ( |entry| entry. flag_decl . as_ref ( ) ) . and_then ( |flag_decl| {
2316- let ( pending_decl, finalized, is_virtual) = flag_decl. get ( ) ;
2317- debug ! ( ?pending_decl, ?is_virtual) ;
2315+ let ( pending_decl, finalized, is_open) = flag_decl. get ( ) ;
23182316 let decl = match pending_decl {
23192317 PendingDecl :: Ready ( decl) => {
2320- if finalize && !finalized && !is_virtual {
2318+ if finalize && !finalized && !is_open {
23212319 self . cstore_mut ( ) . process_path_extern (
23222320 self . tcx ,
23232321 ident. name ,
@@ -2328,7 +2326,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
23282326 }
23292327 PendingDecl :: Pending => {
23302328 debug_assert ! ( !finalized) ;
2331- if is_virtual {
2329+ if is_open {
23322330 let res = Res :: OpenMod ( ident. name ) ;
23332331 Some ( self . arenas . new_pub_def_decl ( res, DUMMY_SP , LocalExpnId :: ROOT ) )
23342332 } else {
@@ -2349,7 +2347,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
23492347 }
23502348 }
23512349 } ;
2352- flag_decl. set ( ( PendingDecl :: Ready ( decl) , finalize || finalized, is_virtual ) ) ;
2350+ flag_decl. set ( ( PendingDecl :: Ready ( decl) , finalize || finalized, is_open ) ) ;
23532351 decl. or_else ( || finalize. then_some ( self . dummy_decl ) )
23542352 } )
23552353 }
@@ -2535,12 +2533,12 @@ fn build_extern_prelude<'tcx, 'ra>(
25352533 } )
25362534 . collect ( ) ;
25372535
2538- // Add virtual base entries for namespaced crates whose base segment
2536+ // Add open base entries for namespaced crates whose base segment
25392537 // is missing from the prelude (e.g. `foo::bar` without `foo`).
25402538 // These are necessary in order to resolve the open modules, whereas
25412539 // the namespaced names are necessary in `extern_prelude` for actually
25422540 // resolving the namespaced crates.
2543- let missing_virtual_bases : Vec < IdentKey > = extern_prelude
2541+ let missing_open_bases : Vec < IdentKey > = extern_prelude
25442542 . keys ( )
25452543 . filter_map ( |ident| {
25462544 let ( base, _) = ident. name . as_str ( ) . split_once ( "::" ) ?;
@@ -2551,11 +2549,9 @@ fn build_extern_prelude<'tcx, 'ra>(
25512549 . collect ( ) ;
25522550
25532551 extern_prelude. extend (
2554- missing_virtual_bases . into_iter ( ) . map ( |ident| ( ident, ExternPreludeEntry :: virtual_flag ( ) ) ) ,
2552+ missing_open_bases . into_iter ( ) . map ( |ident| ( ident, ExternPreludeEntry :: open_flag ( ) ) ) ,
25552553 ) ;
25562554
2557- debug ! ( ?extern_prelude) ;
2558-
25592555 // Inject `core` / `std` unless suppressed by attributes.
25602556 if !attr:: contains_name ( attrs, sym:: no_core) {
25612557 extern_prelude. insert ( IdentKey :: with_root_ctxt ( sym:: core) , ExternPreludeEntry :: flag ( ) ) ;
0 commit comments