Skip to content

compiletest: Make diagnostic kind mandatory on line annotations (take 2) #139720

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
merged 1 commit into from
Apr 30, 2025

Conversation

petrochenkov
Copy link
Contributor

@petrochenkov petrochenkov commented Apr 12, 2025

Compiletest currently accepts line annotations without kind in UI tests.

    let a = b + c; //~ my message

Such annotations have two effects.

  • First, they match any compiler-produced diagnostic kind. This functionality is never used in practice, there are no target-dependent diagnostic kinds of something like that.
  • Second, they are not "viral". For example, any explicit //~ NOTE my msg in a test requires all other NOTE diagnostics in the same test to be annotated. Implicit //~ my msg will just match the note and won't require other annotations.

The second functionality has a replacement since recently - directive //@ dont-require-annotations: NOTE.

This PR removes support for //~ my message and makes the explicit diagnostic kind mandatory.
Unwanted additional annotations are suppressed using the dont-require-annotations directive.

Closes rust-lang/compiler-team#862.
Previous attempt - #139427.
r? @jieyouxu

@rustbot rustbot added A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Apr 12, 2025
@petrochenkov
Copy link
Contributor Author

MCP: rust-lang/compiler-team#862, waiting on compiler team.

@petrochenkov petrochenkov added S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). I-compiler-nominated Nominated for discussion during a compiler team meeting. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 12, 2025
@petrochenkov
Copy link
Contributor Author

Most of the diff is due to updated .stderr files.
Technically I could add the //@ dont-require-annotations: NOTE directives to file ends to avoid this, but it really goes against the usual style.

@rustbot
Copy link
Collaborator

rustbot commented Apr 12, 2025

Some changes occurred in src/tools/compiletest

cc @jieyouxu

@rust-log-analyzer

This comment has been minimized.

Copy link
Member

@RalfJung RalfJung left a comment

Choose a reason for hiding this comment

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

const ui tets changes LGTM, except that the PR also removes some colons which caught me by surprise as it wasn't mentioned... but if we will unify the colon vs no-colon style soon anyway, it doesn't really matter.

@petrochenkov
Copy link
Contributor Author

petrochenkov commented Apr 13, 2025

the PR also removes some colons which caught me by surprise as it wasn't mentioned

This is accidental, this PR was converted from #139427 which had some colon changes, and I tried to revert all of them, but apparently missed some. If some more are found during review I'll revert them too.

@bors

This comment was marked as resolved.

@tshepang
Copy link
Member

would be nice if this also updated rustc-dev-guide

@petrochenkov
Copy link
Contributor Author

would be nice if this also updated rustc-dev-guide

I'll update, I was waiting for #139618 to land first.

@petrochenkov petrochenkov removed the I-compiler-nominated Nominated for discussion during a compiler team meeting. label Apr 17, 2025
@petrochenkov
Copy link
Contributor Author

10 days since rust-lang/compiler-team#862 (comment) have passed.
@rustbot author

@rustbot
Copy link
Collaborator

rustbot commented Apr 26, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Apr 26, 2025
@petrochenkov petrochenkov removed the S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). label Apr 26, 2025
@rustbot rustbot added the A-rustc-dev-guide Area: rustc-dev-guide label Apr 26, 2025
@rustbot
Copy link
Collaborator

rustbot commented Apr 26, 2025

The rustc-dev-guide subtree was changed. If this PR only touches the dev guide consider submitting a PR directly to rust-lang/rustc-dev-guide otherwise thank you for updating the dev guide with your changes.

cc @BoxyUwU, @jieyouxu, @Kobzol

@petrochenkov
Copy link
Contributor Author

@bors r=jieyouxu

@bors
Copy link
Collaborator

bors commented Apr 29, 2025

📌 Commit e3504d1 has been approved by jieyouxu

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 29, 2025
@bors
Copy link
Collaborator

bors commented Apr 29, 2025

⌛ Testing commit e3504d1 with merge cb45107...

bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 29, 2025
compiletest: Make diagnostic kind mandatory on line annotations (take 2)

Compiletest currently accepts line annotations without kind in UI tests.
```
    let a = b + c; //~ my message
```

Such annotations have two effects.
- First, they match any compiler-produced diagnostic kind. This functionality is never used in practice, there are no target-dependent diagnostic kinds of something like that.
- Second, they are not "viral". For example, any explicit `//~ NOTE my msg` in a test requires all other `NOTE` diagnostics in the same test to be annotated. Implicit `//~ my msg` will just match the note and won't require other annotations.

The second functionality has a replacement since recently - directive `//@ dont-require-annotations: NOTE`.

This PR removes support for `//~ my message` and makes the explicit diagnostic kind mandatory.
Unwanted additional annotations are suppressed using the `dont-require-annotations` directive.

Closes rust-lang/compiler-team#862.
Previous attempt - rust-lang#139427.
r? `@jieyouxu`
@rust-log-analyzer

This comment has been minimized.

@bors

This comment was marked as resolved.

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 29, 2025
@jieyouxu
Copy link
Member

Right, some tests are gated behind certain availabilities.

@petrochenkov
Copy link
Contributor Author

@bors r=jieyouxu

@bors
Copy link
Collaborator

bors commented Apr 30, 2025

📌 Commit 20faf85 has been approved by jieyouxu

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 30, 2025
@bors
Copy link
Collaborator

bors commented Apr 30, 2025

⌛ Testing commit 20faf85 with merge d2eadb7...

@bors
Copy link
Collaborator

bors commented Apr 30, 2025

☀️ Test successful - checks-actions
Approved by: jieyouxu
Pushing d2eadb7 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 30, 2025
@bors bors merged commit d2eadb7 into rust-lang:master Apr 30, 2025
7 checks passed
@rustbot rustbot added this to the 1.88.0 milestone Apr 30, 2025
Copy link

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 427288b (parent) -> d2eadb7 (this PR)

Test differences

No test diffs found

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard d2eadb7a94ef8c9deb5137695df33cd1fc5aee92 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. x86_64-apple-2: 7602.6s -> 4664.8s (-38.6%)
  2. x86_64-apple-1: 9212.6s -> 7030.9s (-23.7%)
  3. dist-aarch64-apple: 5027.7s -> 5773.9s (14.8%)
  4. dist-arm-linux: 4502.3s -> 5024.3s (11.6%)
  5. dist-x86_64-mingw: 7935.5s -> 7438.1s (-6.3%)
  6. x86_64-msvc-2: 6888.3s -> 7305.0s (6.0%)
  7. dist-i686-mingw: 7827.2s -> 8246.0s (5.4%)
  8. dist-apple-various: 6792.8s -> 6447.2s (-5.1%)
  9. x86_64-gnu-llvm-20-3: 6700.5s -> 7016.3s (4.7%)
  10. i686-msvc-1: 9310.8s -> 9714.7s (4.3%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d2eadb7): comparison URL.

Overall result: ❌ regressions - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
2.9% [2.9%, 2.9%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.9% [2.9%, 2.9%] 1

Max RSS (memory usage)

Results (primary 0.3%, secondary -0.4%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.7% [0.4%, 1.1%] 22
Regressions ❌
(secondary)
2.6% [2.6%, 2.6%] 1
Improvements ✅
(primary)
-2.9% [-6.3%, -0.6%] 3
Improvements ✅
(secondary)
-3.3% [-3.3%, -3.3%] 1
All ❌✅ (primary) 0.3% [-6.3%, 1.1%] 25

Cycles

Results (primary 0.6%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.0% [0.5%, 2.5%] 5
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.5% [-0.5%, -0.4%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.6% [-0.5%, 2.5%] 7

Binary size

Results (primary 1.1%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.1% [1.1%, 1.1%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.1% [1.1%, 1.1%] 1

Bootstrap: 770.662s -> 770.233s (-0.06%)
Artifact size: 365.58 MiB -> 365.54 MiB (-0.01%)

@rustbot rustbot added the perf-regression Performance regression. label Apr 30, 2025
@jieyouxu
Copy link
Member

This doesn't touch compiler, should just be noise

@Kobzol
Copy link
Contributor

Kobzol commented Apr 30, 2025

Yeah, it's a new benchmark that doesn't have noise threshold set properly yet.

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Apr 30, 2025
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 A-rustc-dev-guide Area: rustc-dev-guide A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

compiletest: Make diagnostic kind mandatory on line annotations
9 participants