-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't suggest to use things which weren't found either. #38054
Comments
Is this easy to fix ? If so - maybe worth marking as so and mentioning on Rust Weekly ? |
@cyplo Yeah, I believe this can be fixed by replacing these lines with |
I think I can take this, if it hasn't been worked on so far! |
@ioctaptceb go for it |
How can I assign myself? |
Not sure if you can via github, due to permissions, but you can just start working on it :) There's a trace in the comments, anyone looking for more work would see them hopefully here in this issue. |
…, r=nikomatsakis Don't suggest to use things which weren't found either Fixes rust-lang#38054 The best code I can come up with, suggestions are welcome. Basically, removing ```. Did you mean to use `DoesntExist1`?``` in the code below, because it is useless. ```rust error[E0432]: unresolved import `DoesntExist1` --> src/lib.rs:1:5 | 1 | use DoesntExist1; | ^^^^^^^^^^^^ no `DoesntExist1` in the root error[E0432]: unresolved import `DoesntExist2` --> src/lib.rs:2:5 | 2 | use DoesntExist2; | ^^^^^^^^^^^^ no `DoesntExist2` in the root. Did you mean to use `DoesntExist1`? ```
…, r=nikomatsakis Don't suggest to use things which weren't found either Fixes rust-lang#38054 The best code I can come up with, suggestions are welcome. Basically, removing ```. Did you mean to use `DoesntExist1`?``` in the code below, because it is useless. ```rust error[E0432]: unresolved import `DoesntExist1` --> src/lib.rs:1:5 | 1 | use DoesntExist1; | ^^^^^^^^^^^^ no `DoesntExist1` in the root error[E0432]: unresolved import `DoesntExist2` --> src/lib.rs:2:5 | 2 | use DoesntExist2; | ^^^^^^^^^^^^ no `DoesntExist2` in the root. Did you mean to use `DoesntExist1`? ```
…, r=nikomatsakis Don't suggest to use things which weren't found either Fixes rust-lang#38054 The best code I can come up with, suggestions are welcome. Basically, removing ```. Did you mean to use `DoesntExist1`?``` in the code below, because it is useless. ```rust error[E0432]: unresolved import `DoesntExist1` --> src/lib.rs:1:5 | 1 | use DoesntExist1; | ^^^^^^^^^^^^ no `DoesntExist1` in the root error[E0432]: unresolved import `DoesntExist2` --> src/lib.rs:2:5 | 2 | use DoesntExist2; | ^^^^^^^^^^^^ no `DoesntExist2` in the root. Did you mean to use `DoesntExist1`? ```
…, r=nikomatsakis Don't suggest to use things which weren't found either Fixes rust-lang#38054 The best code I can come up with, suggestions are welcome. Basically, removing ```. Did you mean to use `DoesntExist1`?``` in the code below, because it is useless. ```rust error[E0432]: unresolved import `DoesntExist1` --> src/lib.rs:1:5 | 1 | use DoesntExist1; | ^^^^^^^^^^^^ no `DoesntExist1` in the root error[E0432]: unresolved import `DoesntExist2` --> src/lib.rs:2:5 | 2 | use DoesntExist2; | ^^^^^^^^^^^^ no `DoesntExist2` in the root. Did you mean to use `DoesntExist1`? ```
Sometimes it is very useful when rustc figures out that the faulty module use you just made is probably just a typo and directs you a potential match (thanks for that!). However it also directs you to potential matches which haven't been found either in certain cases, for example compiling
currently (2016-11-28) yields with both stable and nightly the following output:
While this is merely a suggestion displayed and shouldn't cause any harm at all maybe it might still be worth to check if what is suggested was actually found in the current scope. Or would that be too expensive (e.g. overhead in tracking what was already successfully imported and what not) and is thus left as is by design?
The text was updated successfully, but these errors were encountered: