resolve: Shadow erroneous glob imports with erroneous single imports
This commit is contained in:
parent
b8c35ca26b
commit
f767f2297d
@ -252,7 +252,7 @@ pub(crate) fn try_define(
|
|||||||
self.set_binding_parent_module(binding, module);
|
self.set_binding_parent_module(binding, module);
|
||||||
self.update_resolution(module, key, |this, resolution| {
|
self.update_resolution(module, key, |this, resolution| {
|
||||||
if let Some(old_binding) = resolution.binding {
|
if let Some(old_binding) = resolution.binding {
|
||||||
if res == Res::Err {
|
if res == Res::Err && old_binding.res() != Res::Err {
|
||||||
// Do not override real bindings with `Res::Err`s from error recovery.
|
// Do not override real bindings with `Res::Err`s from error recovery.
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
12
src/test/rustdoc/issue-100241.rs
Normal file
12
src/test/rustdoc/issue-100241.rs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
//! See [`S`].
|
||||||
|
|
||||||
|
// Check that this isn't an ICE
|
||||||
|
// should-fail
|
||||||
|
|
||||||
|
mod foo {
|
||||||
|
pub use inner::S;
|
||||||
|
//~^ ERROR unresolved imports `inner`, `foo::S`
|
||||||
|
}
|
||||||
|
|
||||||
|
use foo::*;
|
||||||
|
use foo::S;
|
Loading…
Reference in New Issue
Block a user