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

Misleading note for error message in proc-macro #47882

Closed
antoyo opened this issue Jan 30, 2018 · 2 comments
Closed

Misleading note for error message in proc-macro #47882

antoyo opened this issue Jan 30, 2018 · 2 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@antoyo
Copy link
Contributor

antoyo commented Jan 30, 2018

Hi.
I created a repository that makes Rust show the following error message:

error[E0308]: mismatched types
 --> src/main.rs:7:1
  |
7 | #[my_attr]
  | ^^^^^^^^^^
  | |
  | expected &str, found struct `std::string::String`
  | help: consider borrowing here: `&#[my_attr]`
  |
  = note: expected type `&str`
             found type `std::string::String`

The help note is misleading and, obviously, does not work.
Thanks to fix this.

@GuillaumeGomez GuillaumeGomez added A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-diagnostics Area: Messages for errors, warnings, and lints labels Jan 30, 2018
@estebank
Copy link
Contributor

Duplicate of #48364, needs to change the following to not include the suggestion when dealing with a macro call:

let sp = self.sess().codemap().call_span_if_macro(expr.span);

@jkordish jkordish added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Apr 23, 2018
@estebank
Copy link
Contributor

Should have been fixed when #48364 was fixed.

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, ..) C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants