Skip to content

Include scope names in diagnostics #2399

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

Closed
da-x opened this issue Apr 12, 2018 · 4 comments
Closed

Include scope names in diagnostics #2399

da-x opened this issue Apr 12, 2018 · 4 comments
Labels
T-compiler Relevant to the compiler team, which will review and decide on the RFC.

Comments

@da-x
Copy link
Member

da-x commented Apr 12, 2018

(reference implementation: rust-lang/rust#49898 )

So far, rustc has only printed about filenames and line numbers for warnings and errors. I think it is rather missed, compared to gcc and other compilers, that useful context information such as function
names and structs is not included.

We can improve the information that rustc prints for warnings and errors in this regard, by adding a new line to precede the warning or the error.

For example:

In function `test`:
warning: unused variable: `a`
In enum `MyEnum`:
warning: variant is never constructed: `ItemB`
  --> various-warnings.rs:8:5
   |
 8 |     ItemB,
   |     ^^
@Ixrec
Copy link
Contributor

Ixrec commented Apr 12, 2018

An issue on the rfcs repo isn't an RFC. See https://github.com/rust-lang/rfcs#what-the-process-is for how to create an RFC.

👍 on the actual idea you're proposing

@da-x
Copy link
Member Author

da-x commented Apr 12, 2018

Thanks - I meant this issue to serve as a pre-RFC.

@Centril Centril added the T-compiler Relevant to the compiler team, which will review and decide on the RFC. label Apr 12, 2018
@Centril
Copy link
Contributor

Centril commented Apr 12, 2018

If you wish to create a pre-RFC, I think it would be better to do that on internals.rust-lang.org as you'll have more reviewers there. If you do file a pre-RFC over there, please close this issue.

@da-x
Copy link
Member Author

da-x commented Apr 13, 2018

@da-x da-x closed this as completed Apr 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-compiler Relevant to the compiler team, which will review and decide on the RFC.
Projects
None yet
Development

No branches or pull requests

3 participants