-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Add ‘help’ messages to rustc #16855
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 ‘help’ messages to rustc #16855
Conversation
You should probably update src/compiletest/runtest.rs to match "help" lines in |
@kballard They are intentionally ignored. That function, as the name suggests, only detects warnings and errors. I consider |
Oh right, notes were ignored already. I missed that bit. In that case, carry on. |
Given that, LGTM, but I'd prefer someone else weigh in on whether this is an appropriate change before r+'ing. |
This looks to convert two messages: the error code message, and a single borrow check note. It's not clear to me what the criteria is for picking @nikomatsakis You will probably have an opinion. |
My feeling is "help" is for "helpful suggestions" whereas "note" is for contextual information that may be useful in interpreting the error. In light of that, the borrowck suggestion is really just a helpful suggestion rather than being contextual information. |
This adds ‘help’ diagnostic messages to rustc. This is used for anything that provides help to the user, particularly the `--explain` messages that were previously integrated into the relevant error message.
1b1912a
to
06d9cc1
Compare
I'm still fine with it. |
I scanned the source for notes that might be candidates for help and found these:
... well, there are a lot. Some notes combine both contextual info and suggestions and need to be separated:
|
Thanks @P1start. Here's an issue for the followup #18126 |
This adds ‘help’ diagnostic messages to rustc. This is used for anything that provides help to the user, particularly the `--explain` messages that were previously integrated into the relevant error message. They look like this: ``` match.rs:10:13: 10:14 error: unreachable pattern [E0001] match.rs:10 1 => {}, ^ match.rs:3:1: 3:38 note: in expansion of foo! match.rs:7:5: 20:2 note: expansion site match.rs:10:13: 10:14 help: pass `--explain E0001` to see a detailed explanation ``` (`help` is coloured cyan.) Adding these errors on a separate line stops the lines from being too long, as discussed in #16619.
This adds ‘help’ diagnostic messages to rustc. This is used for anything that provides help to the user, particularly the
--explain
messages that were previously integrated into the relevant error message.They look like this:
(
help
is coloured cyan.) Adding these errors on a separate line stops the lines from being too long, as discussed in #16619.