Tracking Issue for ambiguous_glob_imports
lint
#114095
Labels
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-future-incompatibility
Category: Future-incompatibility lints
C-tracking-issue
Category: An issue tracking the progress of sth. like the implementation of an RFC
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
This is a tracking issue for the "ambiguous_glob_imports", a lint that follows the breaking change policy.
Problem
The name resolution algorithm in rustc does not update bindings recursively when the
(Module, Key)
already has a binding. This can result in a situation where a glob binding should be marked as ambiguous but it is not, potentially causing code that should fail to compile to pass instead.For example(#112713):
The
C
infoo
function was referred to(Mod(root), Key(C))
, where it should have an ambiguous binding but actually not due to the stop the update process early.Here are additional details regarding the update process:
importer
resolve_glob_import
use sub::*
use mod1::*
(root::sub, C) -> root::sub::mod1::C
without ambiguity;2.
(root, C) -> root::sub::mod1::C
without ambiguity.use mod2::*
(root::sub, C) -> root::sub::mod1::C
with ambiguity;2. It had been stop update the binding of
(root, C)
due to(root, C)
already has a binding.Solve
We have relaxed the condition for update process and now treat the updated ambiguous error as a warning instead of an error. We use the
ambigous_glob_imports
lint for back compatibility.Steps
The text was updated successfully, but these errors were encountered: