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

differentiate between guesses and suggestions in diagnostic messages #37085

Closed
oli-obk opened this issue Oct 11, 2016 · 2 comments
Closed

differentiate between guesses and suggestions in diagnostic messages #37085

oli-obk opened this issue Oct 11, 2016 · 2 comments

Comments

@oli-obk
Copy link
Contributor

oli-obk commented Oct 11, 2016

When the compiler or a lint don't have a true solution to the issue they encountered, they can't use a suggestion, because those are supposed to be correct. But some situations (like "name is not defined or in scope") can't possibly know how to correctly fix the issue. I suggest to add another diagnostic called "guess" (the bikeshed may be of any colour).

The regular text-report won't be changed (so guess shows up as help like it does right now). But the json output would contain the guesses for processing by IDEs and tools like rustfix.

This way, suggestions can be automatically applied and guesses require user interaction to apply them.

The json diagnostic structs will be extended this way:

    /// A list of code snippets that could be used to replace the span,
    /// but may contain wrong suggestions. The user needs to take care
    /// to select the correct one or even ignore all of them.
    guesses: Vec<String>,
@sanxiyn
Copy link
Member

sanxiyn commented Oct 29, 2016

Isn't this #33691?

@oli-obk
Copy link
Contributor Author

oli-obk commented Oct 29, 2016

Jup, it is

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants