@@ -1009,13 +1009,13 @@ impl<'ra> NameBindingData<'ra> {
10091009
10101010#[ derive( Default , Clone ) ]
10111011struct ExternPreludeEntry < ' ra > {
1012- binding : Option < NameBinding < ' ra > > ,
1012+ binding : Cell < Option < NameBinding < ' ra > > > ,
10131013 introduced_by_item : bool ,
10141014}
10151015
10161016impl ExternPreludeEntry < ' _ > {
10171017 fn is_import ( & self ) -> bool {
1018- self . binding . is_some_and ( |binding| binding. is_import ( ) )
1018+ self . binding . get ( ) . is_some_and ( |binding| binding. is_import ( ) )
10191019 }
10201020}
10211021
@@ -2006,7 +2006,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
20062006 // but not introduce it, as used if they are accessed from lexical scope.
20072007 if used == Used :: Scope {
20082008 if let Some ( entry) = self . extern_prelude . get ( & ident. normalize_to_macros_2_0 ( ) ) {
2009- if !entry. introduced_by_item && entry. binding == Some ( used_binding) {
2009+ if !entry. introduced_by_item && entry. binding . get ( ) == Some ( used_binding) {
20102010 return ;
20112011 }
20122012 }
@@ -2170,7 +2170,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
21702170
21712171 let norm_ident = ident. normalize_to_macros_2_0 ( ) ;
21722172 let binding = self . extern_prelude . get ( & norm_ident) . cloned ( ) . and_then ( |entry| {
2173- Some ( if let Some ( binding) = entry. binding {
2173+ Some ( if let Some ( binding) = entry. binding . get ( ) {
21742174 if finalize {
21752175 if !entry. is_import ( ) {
21762176 self . cstore_mut ( ) . process_path_extern ( self . tcx , ident. name , ident. span ) ;
@@ -2195,8 +2195,8 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
21952195 } )
21962196 } ) ;
21972197
2198- if let Some ( entry) = self . extern_prelude . get_mut ( & norm_ident) {
2199- entry. binding = binding;
2198+ if let Some ( entry) = self . extern_prelude . get ( & norm_ident) {
2199+ entry. binding . set ( binding) ;
22002200 }
22012201
22022202 binding
0 commit comments