Skip to content
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

did you mean tar? suggestion without any explanation where tar is from #53445

Closed
oli-obk opened this issue Aug 17, 2018 · 0 comments
Closed

did you mean tar? suggestion without any explanation where tar is from #53445

oli-obk opened this issue Aug 17, 2018 · 0 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@oli-obk
Copy link
Contributor

oli-obk commented Aug 17, 2018

On the playground (which has the tar crate available (or maybe this is rustc in general?))

fn main() {
    bar()
}

(Playground)

Errors:

   Compiling playground v0.0.1 (file:///playground)
error[E0425]: cannot find function `bar` in this scope
 --> src/main.rs:2:5
  |
2 |     bar()
  |     ^^^ did you mean `tar`?

error: aborting due to previous error

For more information about this error, try `rustc --explain E0425`.
error: Could not compile `playground`.

To learn more, run the command again with --verbose.

Following the suggestion gives

error[E0658]: access to extern crates through prelude is experimental (see issue #44660)
 --> src/main.rs:2:5
  |
2 |     tar()
  |     ^^^

error[E0423]: expected function, found module `tar`
 --> src/main.rs:2:5
  |
2 |     tar()
  |     ^^^ not a function

I think we should be adding a note to the "did you mean" mentioning the kind of item, so "did you mean module tar?"

Also it looks to me like this is not a structured suggestion, we should make it one.

@oli-obk oli-obk added the A-diagnostics Area: Messages for errors, warnings, and lints label Aug 17, 2018
Centril added a commit to Centril/rust that referenced this issue Jan 14, 2019
…ckmdavis

clarify resolve typo suggestion

Include the kind of the binding that we're suggesting, and use a
structured suggestion.

Fixes rust-lang#53445.
Centril added a commit to Centril/rust that referenced this issue Jan 14, 2019
…ckmdavis

clarify resolve typo suggestion

Include the kind of the binding that we're suggesting, and use a
structured suggestion.

Fixes rust-lang#53445.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints
Projects
None yet
Development

No branches or pull requests

1 participant