smart_resolve_partial_mod_path_errors should not suggest parent
This commit is contained in:
parent
6f53e61887
commit
9763472e2b
4 changed files with 4 additions and 18 deletions
|
@ -350,9 +350,10 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
|
|||
.filter(|candidate| {
|
||||
if let Some(def_id) = candidate.did &&
|
||||
let Some(module) = self.r.get_module(def_id) {
|
||||
self.r.resolutions(module).borrow().iter().any(|(key, _r)| {
|
||||
key.ident.name == following_seg.ident.name
|
||||
})
|
||||
Some(def_id) != self.parent_scope.module.opt_def_id() &&
|
||||
self.r.resolutions(module).borrow().iter().any(|(key, _r)| {
|
||||
key.ident.name == following_seg.ident.name
|
||||
})
|
||||
} else {
|
||||
false
|
||||
}
|
||||
|
|
|
@ -3,11 +3,6 @@ error[E0433]: failed to resolve: use of undeclared crate or module `foo`
|
|||
|
|
||||
LL | pub fn bar() { foo::baz(); }
|
||||
| ^^^ use of undeclared crate or module `foo`
|
||||
|
|
||||
help: consider importing this module
|
||||
|
|
||||
LL + use crate::foo;
|
||||
|
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
@ -3,11 +3,6 @@ error[E0433]: failed to resolve: use of undeclared crate or module `foo`
|
|||
|
|
||||
LL | pub fn bar() { foo::baz(); }
|
||||
| ^^^ use of undeclared crate or module `foo`
|
||||
|
|
||||
help: consider importing this module
|
||||
|
|
||||
LL + use foo;
|
||||
|
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
@ -36,11 +36,6 @@ error[E0433]: failed to resolve: use of undeclared crate or module `bar`
|
|||
|
|
||||
LL | pub fn bar() { bar::baz(); }
|
||||
| ^^^ use of undeclared crate or module `bar`
|
||||
|
|
||||
help: consider importing this module
|
||||
|
|
||||
LL + use crate::bar;
|
||||
|
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue