Skip to content
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

Prevent a test from seeing forbidden numbers in the rustc version #139438

Merged
merged 1 commit into from
Apr 6, 2025

Conversation

Zalathar
Copy link
Contributor

@Zalathar Zalathar commented Apr 6, 2025

The final CHECK-NOT directive in this test was able to see past the end of the enclosing function, and find the substring 753 or 754 in the git hash in the rustc version number, causing false failures in CI whenever the git hash happens to contain those digits in sequence.

Adding an explicit check for ret prevents the CHECK-NOT directive from seeing past the end of the function.


Manually tested by adding // CHECK-NOT: rustc after the existing CHECK-NOT directives, and demonstrating that the new check prevents it from seeing the rustc version string.

The final CHECK-NOT directive in this test was able to see past the end of the
enclosing function, and find the substring 753 or 754 in the git hash in the
rustc version number, causing false failures in CI.

Adding an explicit check for `ret` prevents the CHECK-NOT directive from seeing
past the end of the function.
@rustbot
Copy link
Collaborator

rustbot commented Apr 6, 2025

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 6, 2025
@Zalathar
Copy link
Contributor Author

Zalathar commented Apr 6, 2025

Fixes the false failure seen in #139123 (comment).

cc @scottmcm via #137500, which added the CHECK-NOT directives.

@scottmcm
Copy link
Member

scottmcm commented Apr 6, 2025

Doh, these hashes again. Thanks!

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Apr 6, 2025

📌 Commit f6afb35 has been approved by scottmcm

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 6, 2025
@scottmcm scottmcm assigned scottmcm and unassigned Mark-Simulacrum Apr 6, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 6, 2025
Rollup of 3 pull requests

Successful merges:

 - rust-lang#139123 (tidy: Fix paths to `coretests` and `alloctests`)
 - rust-lang#139347 (Only build `rust_test_helpers` for `{incremental,ui}` test suites)
 - rust-lang#139438 (Prevent a test from seeing forbidden numbers in the rustc version)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit f4aa209 into rust-lang:master Apr 6, 2025
6 checks passed
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 6, 2025
Rollup merge of rust-lang#139438 - Zalathar:fix-test-122600, r=scottmcm

Prevent a test from seeing forbidden numbers in the rustc version

The final CHECK-NOT directive in this test was able to see past the end of the enclosing function, and find the substring `753` or `754` in the git hash in the rustc version number, causing false failures in CI whenever the git hash happens to contain those digits in sequence.

Adding an explicit check for `ret` prevents the CHECK-NOT directive from seeing past the end of the function.

---

Manually tested by adding `// CHECK-NOT: rustc` after the existing CHECK-NOT directives, and demonstrating that the new check prevents it from seeing the rustc version string.
@rustbot rustbot added this to the 1.88.0 milestone Apr 6, 2025
@Zalathar Zalathar deleted the fix-test-122600 branch April 6, 2025 10:43
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants