File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -858,6 +858,10 @@ impl<'a> CrateLoader<'a> {
858858 } ) ;
859859 }
860860
861+ pub fn loaded_crates ( & self ) -> & FxHashSet < Symbol > {
862+ self . loaded_crates . as_ref ( ) . unwrap ( )
863+ }
864+
861865 pub fn take_loaded_crates ( & mut self ) -> FxHashSet < Symbol > {
862866 self . loaded_crates . take ( ) . unwrap ( )
863867 }
Original file line number Diff line number Diff line change @@ -1276,7 +1276,6 @@ impl<'a> Resolver<'a> {
12761276 . iter ( )
12771277 . map ( |( ident, entry) | ( ident. name , entry. introduced_by_item ) )
12781278 . collect ( ) ,
1279- // The used crates are finalized at this point
12801279 used_crates : Some ( used_crates) ,
12811280 }
12821281 }
@@ -1296,13 +1295,7 @@ impl<'a> Resolver<'a> {
12961295 . iter ( )
12971296 . map ( |( ident, entry) | ( ident. name , entry. introduced_by_item ) )
12981297 . collect ( ) ,
1299- // The used crates are not finalized at this point - lowering the AST
1300- // may cause us to call `Resolver.extern_prelude_get`,
1301- // which may update the set of used crates even if a
1302- // new crate is not loaded from disk
1303- // We should never actually need to access this, but we set it to
1304- // `None` so that we get an ICE if we try to unwrap it
1305- used_crates : None ,
1298+ used_crates : Some ( self . crate_loader . loaded_crates ( ) . clone ( ) ) ,
13061299 }
13071300 }
13081301
You can’t perform that action at this time.
0 commit comments