@@ -1009,13 +1009,13 @@ impl<'ra> NameBindingData<'ra> {
1009
1009
1010
1010
#[ derive( Default , Clone ) ]
1011
1011
struct ExternPreludeEntry < ' ra > {
1012
- binding : Option < NameBinding < ' ra > > ,
1012
+ binding : Cell < Option < NameBinding < ' ra > > > ,
1013
1013
introduced_by_item : bool ,
1014
1014
}
1015
1015
1016
1016
impl ExternPreludeEntry < ' _ > {
1017
1017
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 ( ) )
1019
1019
}
1020
1020
}
1021
1021
@@ -2006,7 +2006,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
2006
2006
// but not introduce it, as used if they are accessed from lexical scope.
2007
2007
if used == Used :: Scope {
2008
2008
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) {
2010
2010
return ;
2011
2011
}
2012
2012
}
@@ -2170,7 +2170,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
2170
2170
2171
2171
let norm_ident = ident. normalize_to_macros_2_0 ( ) ;
2172
2172
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 ( ) {
2174
2174
if finalize {
2175
2175
if !entry. is_import ( ) {
2176
2176
self . cstore_mut ( ) . process_path_extern ( self . tcx , ident. name , ident. span ) ;
@@ -2195,8 +2195,8 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
2195
2195
} )
2196
2196
} ) ;
2197
2197
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) ;
2200
2200
}
2201
2201
2202
2202
binding
0 commit comments