Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

~? 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

Merged
jieyouxu merged 1 commit into master from tshepang-patch-1
May 23, 2025
Merged

~? annotation type is special #2403

jieyouxu merged 1 commit into master from tshepang-patch-1
May 23, 2025

Conversation

Copy link
Member

@tshepang tshepang commented May 22, 2025

It does not do any line matching, so it should be separated from the other types

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
Copy link
Member

@JohnTitor JohnTitor May 22, 2025

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.

petrochenkov reacted with thumbs up emoji
Copy link
Member Author

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

Copy link
Member

@jieyouxu jieyouxu May 22, 2025
edited
Loading

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
Comment on lines 222 to 224
`~?` 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.
Copy link
Member

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?

Copy link
Member Author

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

Copy link
Member

@jieyouxu jieyouxu May 22, 2025
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"//~? DIAGNOSTIC_KIND" :D

Copy link
Member Author

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

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
Copy link
Member

@jieyouxu jieyouxu May 22, 2025
edited
Loading

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.

@jieyouxu jieyouxu added S-waiting-on-author Status: this PR is waiting for additional action by the OP A-compiletest Area: src/tools/compiletest A-test-suite Area: rust-lang/rust test suites T-compiler Relevant to compiler team labels May 22, 2025
@jieyouxu jieyouxu self-assigned this May 22, 2025
It does not do any line matching, so it should be separated from the other types.
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wording seems fine, we can always further adjust if needed. Thanks!

@jieyouxu jieyouxu merged commit 8392ed6 into master May 23, 2025
1 check passed
@tshepang tshepang deleted the tshepang-patch-1 branch May 23, 2025 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@JohnTitor JohnTitor JohnTitor left review comments

@jieyouxu jieyouxu jieyouxu approved these changes

Labels
A-compiletest Area: src/tools/compiletest A-test-suite Area: rust-lang/rust test suites S-waiting-on-author Status: this PR is waiting for additional action by the OP T-compiler Relevant to compiler team
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /