-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Fix malformed error annotations in a UI test #136403
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r? @chenyukang rustbot has assigned @chenyukang. Use |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 2, 2025
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#136145 (Test validity of pattern types) - rust-lang#136339 (CompileTest: Add Directives to Ignore `arm-unknown-*` Targets) - rust-lang#136403 (Fix malformed error annotations in a UI test) - rust-lang#136414 (Shorten error message for callable with wrong return type) - rust-lang#136425 (Move `rustc_middle::infer::unify_key`) - rust-lang#136426 (Explain why we retroactively change a static initializer to have a different type) - rust-lang#136445 (Couple of cleanups to DiagCtxt and EarlyDiagCtxt) - rust-lang#136452 (Miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 2, 2025
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#136145 (Test validity of pattern types) - rust-lang#136339 (CompileTest: Add Directives to Ignore `arm-unknown-*` Targets) - rust-lang#136403 (Fix malformed error annotations in a UI test) - rust-lang#136414 (Shorten error message for callable with wrong return type) - rust-lang#136425 (Move `rustc_middle::infer::unify_key`) - rust-lang#136426 (Explain why we retroactively change a static initializer to have a different type) - rust-lang#136445 (Couple of cleanups to DiagCtxt and EarlyDiagCtxt) - rust-lang#136452 (Miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 3, 2025
Rollup merge of rust-lang#136403 - fmease:fix-a-ui-test, r=oli-obk Fix malformed error annotations in a UI test The compiletest DSL still features a historical remnant from the time when its directives were merely prefixed with `//` instead of `//`@`` when unknown directive names weren't rejected since they could just as well be part of prose: As an "optimization", it stops looking for directives once it stumbles upon a line which starts with either `fn` or `mod`. This allowed a malformed error annotation of the form `//`@[…]~^^^`` to go undetected & unexercised (as it's placed below `fn main() {`). Obviously a character other than ``@`` would've mangled the error annotation, too (but it might've caught the reviewer's eye). I specifically found this file because I ran `rg '^(fn|mod)[\s\S]*?//`@'` tests/ui --multiline -trust` to check how footgun-y that "special feature" of compiletest is.
jieyouxu
added a commit
to jieyouxu/rust
that referenced
this pull request
Feb 3, 2025
…-past, r=Noratrieb,jieyouxu Remove a footgun-y feature / relic of the past from the compiletest DSL The compiletest DSL still features a historical remnant from the time when its directives were merely prefixed with `//` instead of `//`@`` when unknown directive names weren't rejected since they could just as well be part of prose: As an "optimization", it stops looking for directives once it stumbles upon a line which starts with either `fn` or `mod`. This is super footgun-y as it obviously leads to any seeming compiletest directives below `fn` and `mod` items getting completely ignored. See rust-lang#136403 for a practical example. As well the assembly test updated in this PR. ~~Blocked on rust-lang#136403.~~ (merged)
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 3, 2025
Rollup merge of rust-lang#136404 - fmease:rm-compiletest-relic-of-the-past, r=Noratrieb,jieyouxu Remove a footgun-y feature / relic of the past from the compiletest DSL The compiletest DSL still features a historical remnant from the time when its directives were merely prefixed with `//` instead of `//`@`` when unknown directive names weren't rejected since they could just as well be part of prose: As an "optimization", it stops looking for directives once it stumbles upon a line which starts with either `fn` or `mod`. This is super footgun-y as it obviously leads to any seeming compiletest directives below `fn` and `mod` items getting completely ignored. See rust-lang#136403 for a practical example. As well the assembly test updated in this PR. ~~Blocked on rust-lang#136403.~~ (merged)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The compiletest DSL still features a historical remnant from the time when its directives were merely prefixed with
//
instead of//@
when unknown directive names weren't rejected since they could just as well be part of prose:As an "optimization", it stops looking for directives once it stumbles upon a line which starts with either
fn
ormod
. This allowed a malformed error annotation of the form//@[…]~^^^
to go undetected & unexercised (as it's placed belowfn main() {
).Obviously a character other than
@
would've mangled the error annotation, too (but it might've caught the reviewer's eye). I specifically found this file because I ranrg '^(fn|mod)[\s\S]*?//@' tests/ui --multiline -trust
to check how footgun-y that "special feature" of compiletest is.