Skip to content

Commit 51f18e4

Browse files
revert change in finalize_resolutions_in + other small things
1 parent c07c81e commit 51f18e4

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

compiler/rustc_resolve/src/imports.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
342342
&& (vis == import_vis
343343
|| max_vis.get().is_none_or(|max_vis| vis.is_at_least(max_vis, self.tcx)))
344344
{
345-
// FIXME(batched): Will be fixed in batched import resolution.
346-
max_vis.set_unchecked(Some(vis.expect_local()))
345+
max_vis.set(Some(vis.expect_local()), self)
347346
}
348347

349348
self.arenas.alloc_name_binding(NameBindingData {
@@ -979,8 +978,9 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
979978
import: Import<'ra>,
980979
) -> (Option<SideEffect<'ra>>, usize) {
981980
debug!(
982-
"(resolving import for module) resolving import `{}::...` in `{}`",
981+
"(resolving import for module) resolving import `{}::{}` in `{}`",
983982
Segment::names_to_string(&import.module_path),
983+
import_kind_to_string(&import.kind),
984984
module_to_string(import.parent_scope.module).unwrap_or_else(|| "???".to_string()),
985985
);
986986
let module = if let Some(module) = import.imported_module.get() {
@@ -1047,7 +1047,6 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
10471047
None
10481048
}
10491049
};
1050-
// FIXME(batched): Will be fixed in batched import resolution.
10511050
import_bindings[ns] = pending_binding;
10521051
}
10531052
}
@@ -1648,7 +1647,8 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
16481647

16491648
module.for_each_child(self, |this, ident, _, binding| {
16501649
let res = binding.res().expect_non_local();
1651-
if res != def::Res::Err && !binding.is_ambiguity_recursive() {
1650+
let error_ambiguity = binding.is_ambiguity_recursive() && !binding.warn_ambiguity;
1651+
if res != def::Res::Err && !error_ambiguity {
16521652
let mut reexport_chain = SmallVec::new();
16531653
let mut next_binding = binding;
16541654
while let NameBindingKind::Import { binding, import, .. } = next_binding.kind {

compiler/rustc_resolve/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2598,6 +2598,13 @@ mod ref_mut {
25982598
CmCell(Cell::new(value))
25992599
}
26002600

2601+
pub(crate) fn set<'ra, 'tcx>(&self, val: T, r: &Resolver<'ra, 'tcx>) {
2602+
if r.assert_speculative {
2603+
panic!()
2604+
}
2605+
self.0.set(val);
2606+
}
2607+
26012608
pub(crate) fn set_unchecked(&self, val: T) {
26022609
self.0.set(val);
26032610
}

0 commit comments

Comments
 (0)