Skip to content

Add a dont-check-error-annotations to compiletest #132647

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

Closed
BoxyUwU opened this issue Nov 5, 2024 · 1 comment · Fixed by #139489
Closed

Add a dont-check-error-annotations to compiletest #132647

BoxyUwU opened this issue Nov 5, 2024 · 1 comment · Fixed by #139489
Labels
A-compiletest Area: The compiletest test runner C-feature-request Category: A feature request, i.e: not implemented / a PR. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@BoxyUwU
Copy link
Member

BoxyUwU commented Nov 5, 2024

cc @jieyouxu

It would be nice if compiletest could support a //@ dont-check-error-annotations annotation that would not require you to annotate your file with //~^ ERROR: anywhere. This would be useful for cases where I only care that the test doesn't start ICEing. Ideally we'd never need this but sometimes I wind up with hundreds of errors with useless spans and it's just not realistic (or helpful) to annotate it all. See for example this test, all the error annotations are in the wrong place as macro diagnostics emit the error on the macro definition not the caller. This means that we'd wind up with ~100 error annotations on the insides of the macros which is not a helpful assertion whatsoever.

@BoxyUwU BoxyUwU added A-compiletest Area: The compiletest test runner C-feature-request Category: A feature request, i.e: not implemented / a PR. labels Nov 5, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 5, 2024
@BoxyUwU BoxyUwU added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Nov 5, 2024
@jieyouxu
Copy link
Member

Somewhat related is also #46667.

@bors bors closed this as completed in 4911635 Apr 10, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Apr 10, 2025
Rollup merge of rust-lang#139489 - petrochenkov:noreqann, r=jieyouxu

compiletest: Add directive `dont-require-annotations`

for making matching on specific diagnostic kinds non-exhaustive.

E.g. `//@ dont-require-annotations:ERROR`, like in the examples in this PR.

cc rust-lang#139427 (comment)

Closes rust-lang#132647 FYI `@BoxyUwU` since you've wanted this.

r? `@jieyouxu`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: The compiletest test runner C-feature-request Category: A feature request, i.e: not implemented / a PR. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants