Open
Description
openedon Dec 2, 2021
Due to recently merged PR #91045 duplicate error message can occur if a crate introduced via extern crate
is not resolved successfully and subsequently symbol paths are derived via use
from this missing crate.
Given the following code:
extern crate foo;
use foo::bar;
fn main() {
bar::baz();
}
The current output is:
error[E0463]: can't find crate for `foo`
--> src\main.rs:1:1
|
1 | extern crate foo;
| ^^^^^^^^^^^^^^^^^ can't find crate
error[E0433]: failed to resolve: use of undeclared crate or module `bar`
--> src\main.rs:6:5
|
6 | bar::buzz();
| ^^^ use of undeclared crate or module `bar`
Ideally, a missing name should be issued for the missing crate and then silenced for names whose path is rooted in that crate:
error[E0463]: can't find crate for `foo`
--> src\main.rs:1:1
|
1 | extern crate foo;
| ^^^^^^^^^^^^^^^^^ can't find crate
@rustbot claim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment