Skip to content

Commit 7ce6328

Browse files
revert change in finalize_resolutions_in + other small things
1 parent e36db52 commit 7ce6328

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

compiler/rustc_resolve/src/imports.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +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-
max_vis.set_unchecked(Some(vis.expect_local()))
345+
max_vis.set(Some(vis.expect_local()), self)
346346
}
347347

348348
self.arenas.alloc_name_binding(NameBindingData {
@@ -980,8 +980,9 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
980980
import: Import<'ra>,
981981
) -> (Option<SideEffect<'ra>>, usize) {
982982
debug!(
983-
"(resolving import for module) resolving import `{}::...` in `{}`",
983+
"(resolving import for module) resolving import `{}::{}` in `{}`",
984984
Segment::names_to_string(&import.module_path),
985+
import_kind_to_string(&import.kind),
985986
module_to_string(import.parent_scope.module).unwrap_or_else(|| "???".to_string()),
986987
);
987988
let module = if let Some(module) = import.imported_module.get() {
@@ -1048,7 +1049,6 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
10481049
None
10491050
}
10501051
};
1051-
// FIXME(batched): Will be fixed in batched import resolution.
10521052
import_bindings[ns] = pending_binding;
10531053
}
10541054
}
@@ -1653,7 +1653,8 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
16531653

16541654
module.for_each_child(self, |this, ident, _, binding| {
16551655
let res = binding.res().expect_non_local();
1656-
if res != def::Res::Err && !binding.is_ambiguity_recursive() {
1656+
let error_ambiguity = binding.is_ambiguity_recursive() && !binding.warn_ambiguity;
1657+
if res != def::Res::Err && !error_ambiguity {
16571658
let mut reexport_chain = SmallVec::new();
16581659
let mut next_binding = binding;
16591660
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
@@ -2609,6 +2609,13 @@ mod ref_mut {
26092609
CmCell(Cell::new(value))
26102610
}
26112611

2612+
pub(crate) fn set<'ra, 'tcx>(&self, val: T, r: &Resolver<'ra, 'tcx>) {
2613+
if r.assert_speculative {
2614+
panic!()
2615+
}
2616+
self.0.set(val);
2617+
}
2618+
26122619
pub(crate) fn set_unchecked(&self, val: T) {
26132620
self.0.set(val);
26142621
}

0 commit comments

Comments
 (0)