-
Notifications
You must be signed in to change notification settings - Fork 547
~? annotation type is special #2403
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
base: master
Are you sure you want to change the base?
Conversation
@@ -192,7 +192,7 @@ They have several forms, but generally are a comment with the diagnostic level | |||
to write out the entire message, just make sure to include the important part of | |||
the message to make it self-documenting. | |||
|
|||
The error annotation needs to match with the line of the diagnostic. There are | |||
Most error annotations need to match with the line of the diagnostic. There are |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if we need this change; ~?
actually matches the line not having the following message.
Emphasizing "not" would be enough for me if it's unclear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that does not sound right... ~?
is about errors without line information, while this group is about annotations tied to lines in the source code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, //~?
is used to match diagnostics without line information in the main test file. Possible cases:
- Simply no line info at all.
- Line info beyond main test file (w/ annotations), e.g. from auxiliaries or sources that we have no control over.
src/tests/ui.md
Outdated
`~?` is used to match error levels and messages with errors not having line | ||
information. These can be placed on any line in the test file, but are | ||
conventionally placed at the end. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: can you use the full form i.e. //~? ERROR
to make it more immediately obvious?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ERROR
is just one of the error kinds/levels though, in that there could also be WARN and NOTE, for example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"//~? DIAGNOSTIC_KIND
" :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... I improved the paragraph further
@@ -192,7 +192,7 @@ They have several forms, but generally are a comment with the diagnostic level | |||
to write out the entire message, just make sure to include the important part of | |||
the message to make it self-documenting. | |||
|
|||
The error annotation needs to match with the line of the diagnostic. There are | |||
Most error annotations need to match with the line of the diagnostic. There are |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, //~?
is used to match diagnostics without line information in the main test file. Possible cases:
- Simply no line info at all.
- Line info beyond main test file (w/ annotations), e.g. from auxiliaries or sources that we have no control over.
It does not do any line matching, so it should be separated from the other types.
07120eb
to
eeafdb1
Compare
It does not do any line matching, so it should be separated from the other types