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

Add suggestions for potentially misspelled #[derive] traits #39323

Closed
elliotekj opened this issue Jan 26, 2017 · 3 comments
Closed

Add suggestions for potentially misspelled #[derive] traits #39323

elliotekj opened this issue Jan 26, 2017 · 3 comments
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)

Comments

@elliotekj
Copy link

I ran into an error when compiling a program a couple of days ago that turned out to be due to a spelling mistake. It was suggested by @carols10cents that I create an issue here to discuss adding a “Did you mean X?” hint when compiling fails because of a trait's name.

For clarity's sake, the screenshot below was the error I got and this is the sort of thing I'm suggesting:

error: Custom traits have been depreciated.
 --> src/main.rs:1:10
  |
1 | #[derive(debug)]
  |          ^^^^^
note: Did you mean `#[derive(Debug)]`?

screen shot 2017-01-24 at 21 30 21

I expect this hinges somewhat on whether or not #29644 goes through.

@jseyfried jseyfried self-assigned this Jan 31, 2017
@jseyfried jseyfried added A-diagnostics Area: Messages for errors, warnings, and lints A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) labels Jan 31, 2017
@jseyfried
Copy link
Contributor

cc @keeperofdakeys

@keeperofdakeys
Copy link
Contributor

By the way, I'm currently working on fixing this.

@petrochenkov
Copy link
Contributor

cc #30197 (comment)

bors added a commit that referenced this issue Feb 16, 2017
Refactor macro resolution errors + add derive macro suggestions

Move legacy macro resolution error reporting to `finalize_current_module_macro_resolutions`, and provide suggestions for derive macros.

Fixes #39323

cc #30197

r? @jseyfried
bors added a commit that referenced this issue Feb 17, 2017
Refactor macro resolution errors + add derive macro suggestions

Move legacy macro resolution error reporting to `finalize_current_module_macro_resolutions`, and provide suggestions for derive macros.

Fixes #39323

cc #30197

r? @jseyfried
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 A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
Projects
None yet
Development

No branches or pull requests

4 participants