"Cachify" ExternPreludeEntry.binding through a Cell.
This commit is contained in:
@@ -984,18 +984,17 @@ impl<'a, 'ra, 'tcx> BuildReducedGraphVisitor<'a, 'ra, 'tcx> {
|
||||
// more details: https://github.com/rust-lang/rust/pull/111761
|
||||
return;
|
||||
}
|
||||
let entry = self
|
||||
.r
|
||||
.extern_prelude
|
||||
.entry(ident)
|
||||
.or_insert(ExternPreludeEntry { binding: None, introduced_by_item: true });
|
||||
let entry = self.r.extern_prelude.entry(ident).or_insert(ExternPreludeEntry {
|
||||
binding: Cell::new(None),
|
||||
introduced_by_item: true,
|
||||
});
|
||||
if orig_name.is_some() {
|
||||
entry.introduced_by_item = true;
|
||||
}
|
||||
// Binding from `extern crate` item in source code can replace
|
||||
// a binding from `--extern` on command line here.
|
||||
if !entry.is_import() {
|
||||
entry.binding = Some(imported_binding)
|
||||
entry.binding.set(Some(imported_binding));
|
||||
} else if ident.name != kw::Underscore {
|
||||
self.r.dcx().span_delayed_bug(
|
||||
item.span,
|
||||
|
||||
Reference in New Issue
Block a user