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| {
|
.filter(|candidate| {
|
||||||
if let Some(def_id) = candidate.did &&
|
if let Some(def_id) = candidate.did &&
|
||||||
let Some(module) = self.r.get_module(def_id) {
|
let Some(module) = self.r.get_module(def_id) {
|
||||||
self.r.resolutions(module).borrow().iter().any(|(key, _r)| {
|
Some(def_id) != self.parent_scope.module.opt_def_id() &&
|
||||||
key.ident.name == following_seg.ident.name
|
self.r.resolutions(module).borrow().iter().any(|(key, _r)| {
|
||||||
})
|
key.ident.name == following_seg.ident.name
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,11 +3,6 @@ error[E0433]: failed to resolve: use of undeclared crate or module `foo`
|
||||||
|
|
|
|
||||||
LL | pub fn bar() { foo::baz(); }
|
LL | pub fn bar() { foo::baz(); }
|
||||||
| ^^^ use of undeclared crate or module `foo`
|
| ^^^ use of undeclared crate or module `foo`
|
||||||
|
|
|
||||||
help: consider importing this module
|
|
||||||
|
|
|
||||||
LL + use crate::foo;
|
|
||||||
|
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
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(); }
|
LL | pub fn bar() { foo::baz(); }
|
||||||
| ^^^ use of undeclared crate or module `foo`
|
| ^^^ use of undeclared crate or module `foo`
|
||||||
|
|
|
||||||
help: consider importing this module
|
|
||||||
|
|
|
||||||
LL + use foo;
|
|
||||||
|
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
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(); }
|
LL | pub fn bar() { bar::baz(); }
|
||||||
| ^^^ use of undeclared crate or module `bar`
|
| ^^^ use of undeclared crate or module `bar`
|
||||||
|
|
|
||||||
help: consider importing this module
|
|
||||||
|
|
|
||||||
LL + use crate::bar;
|
|
||||||
|
|
|
||||||
|
|
||||||
error: aborting due to 4 previous errors
|
error: aborting due to 4 previous errors
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue