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

Incremental ThinLTO tests attribute rustc_expected_cgu_reuse ignored #118972

Closed
Enselic opened this issue Dec 15, 2023 · 0 comments · Fixed by #118973
Closed

Incremental ThinLTO tests attribute rustc_expected_cgu_reuse ignored #118972

Enselic opened this issue Dec 15, 2023 · 0 comments · Fixed by #118973
Labels
A-incr-comp Area: Incremental compilation A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Enselic
Copy link
Member

Enselic commented Dec 15, 2023

Currently rustc_expected_cgu_reuse is in practice ignored. These tests use that attribute:

  • tests/incremental/thinlto/cgu_invalidated_via_import.rs
  • tests/incremental/thinlto/cgu_keeps_identical_fn.rs
  • tests/incremental/thinlto/independent_cgus_dont_affect_each_other.rs

Step-by-step

  1. Change the value of kind field of any rustc_expected_cgu_reuse attribute in any test that uses rustc_expected_cgu_reuse.
  2. Run the test, e.g. with ./x test tests/incremental/thinlto

Expected

Test fails since we changed the expected outcome

Actual

Test pass, because rustc_expected_cgu_reuse is in practice ignored.

Example:
This PR should have failed CI but it didn't: #118971

How to fix

Here is a PR with a fix: #118973

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Dec 15, 2023
@Enselic Enselic added A-testsuite Area: The testsuite used to check the correctness of rustc T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Dec 15, 2023
@michaelwoerister michaelwoerister added the A-incr-comp Area: Incremental compilation label Dec 15, 2023
compiler-errors added a commit to compiler-errors/rust that referenced this issue Dec 19, 2023
… r=michaelwoerister

rustc_codegen_ssa: Don't drop `IncorrectCguReuseType` , make `rustc_expected_cgu_reuse` attr work

In [100753], `IncorrectCguReuseType` accidentally stopped being emitted by removing `diag.span_err(...)`. Begin emitting it again rather than just blindly dropping it, and adjust tests accordingly.

We assume that there are no bugs and that the currently actual CGU reuse is correct. If there are bugs, they will be discovered and fixed eventually, and the tests will then be updated.

[100753]: rust-lang@706452e#diff-048389738ddcbe0f9765291a29db1fed9a5f03693d4781cfb5aaa97ffb3c7f84

Closes rust-lang#118972
@bors bors closed this as completed in df4d563 Dec 20, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Dec 20, 2023
Rollup merge of rust-lang#118973 - Enselic:fix-IncorrectCguReuseType, r=michaelwoerister

rustc_codegen_ssa: Don't drop `IncorrectCguReuseType` , make `rustc_expected_cgu_reuse` attr work

In [100753], `IncorrectCguReuseType` accidentally stopped being emitted by removing `diag.span_err(...)`. Begin emitting it again rather than just blindly dropping it, and adjust tests accordingly.

We assume that there are no bugs and that the currently actual CGU reuse is correct. If there are bugs, they will be discovered and fixed eventually, and the tests will then be updated.

[100753]: rust-lang@706452e#diff-048389738ddcbe0f9765291a29db1fed9a5f03693d4781cfb5aaa97ffb3c7f84

Closes rust-lang#118972
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-incr-comp Area: Incremental compilation A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
3 participants