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

Rework no_coverage to coverage(off) #114656

Merged
merged 5 commits into from
Sep 14, 2023
Merged

Conversation

bossmc
Copy link
Contributor

@bossmc bossmc commented Aug 9, 2023

As discussed at the tail of #84605 this replaces the no_coverage attribute with a coverage attribute that takes sub-parameters (currently off and on) to control the coverage instrumentation.

Allows future-proofing for things like coverage(off, reason="Tested live", issue="#12345") or similar.

@rustbot
Copy link
Collaborator

rustbot commented Aug 9, 2023

r? @oli-obk

(rustbot has picked a reviewer for you, use r? to override)

@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. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Aug 9, 2023
@rustbot
Copy link
Collaborator

rustbot commented Aug 9, 2023

Changes to the code generated for builtin derived traits.

cc @nnethercote

@rust-log-analyzer

This comment has been minimized.

@mati865
Copy link
Contributor

mati865 commented Aug 9, 2023

Fantastic!
I've been getting to do it myself but couldn't find the time. While I was thinking about it I think I thought some grace period would be nice given how widespread this feature is (if it's not too hard to do). Otherwise it might be hard to coordinate with crates like https://github.com/taiki-e/coverage-helper

@bossmc
Copy link
Contributor Author

bossmc commented Aug 9, 2023

The old model uses a feature-flag called no_coverage to control access to an attribute called no_coverage (which, as you say, might be baked into various tools). The new model uses the coverage feature flag to control access to the coverage attribute. I suppose we could just leave the old feature and attribute as they were (with a lint warning that they're being dropped in favour of the new one?) to act as a grace period.

@bossmc bossmc force-pushed the rework-no-coverage-attr branch from 1c02438 to 9a5ac56 Compare August 9, 2023 18:45
@rustbot
Copy link
Collaborator

rustbot commented Aug 9, 2023

Some changes occurred in src/tools/rust-analyzer

cc @rust-lang/rust-analyzer

@estebank estebank self-assigned this Aug 11, 2023
@bossmc bossmc force-pushed the rework-no-coverage-attr branch from c7e6502 to 8239f59 Compare August 11, 2023 22:29
@oli-obk
Copy link
Contributor

oli-obk commented Sep 5, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Sep 5, 2023

📌 Commit 60a9007 has been approved by oli-obk

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 Sep 5, 2023
@bors
Copy link
Contributor

bors commented Sep 5, 2023

⌛ Testing commit 60a9007 with merge e216e03ca4c1bae9b161ea9b659cdec63171596e...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Sep 5, 2023

💔 Test failed - checks-actions

@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 Sep 5, 2023
@Zalathar
Copy link
Contributor

Zalathar commented Sep 5, 2023

A few of the tests in tests/run-coverage use #[no_coverage], so they’ll need to be updated and re-blessed.

Note that those tests only run if you have the profiler runtime enabled in your config.toml (otherwise they automatically get ignored silently).

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 14, 2023
@bors bors merged commit c728bf3 into rust-lang:master Sep 14, 2023
11 checks passed
@rustbot rustbot added this to the 1.74.0 milestone Sep 14, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (c728bf3): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

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
Regressions ❌
(secondary)
0.7% [0.7%, 0.8%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-7.8% [-13.3%, -2.1%] 4
All ❌✅ (primary) - - 0

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

Results

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.0% [0.0%, 0.0%] 2
Regressions ❌
(secondary)
0.2% [0.2%, 0.2%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [0.0%, 0.0%] 2

Bootstrap: 631.556s -> 631.545s (-0.00%)
Artifact size: 317.95 MiB -> 317.98 MiB (0.01%)

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Sep 14, 2023
Fix the error message for `#![feature(no_coverage)]`

When rust-lang#114656 was written, the feature flag to replace `no_coverage` was originally spelled `coverage`, but it was eventually changed to `coverage_attribute` instead.

That update happened to miss this error message in `removed.rs`, and unfortunately I only noticed just *after* the original PR was approved and merged.

cc `@bossmc` (original author) `@oli-obk` (original reviewer)
`@rustbot` label +A-code-coverage
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Sep 14, 2023
Fix the error message for `#![feature(no_coverage)]`

When rust-lang#114656 was written, the feature flag to replace `no_coverage` was originally spelled `coverage`, but it was eventually changed to `coverage_attribute` instead.

That update happened to miss this error message in `removed.rs`, and unfortunately I only noticed just *after* the original PR was approved and merged.

cc ``@bossmc`` (original author) ``@oli-obk`` (original reviewer)
``@rustbot`` label +A-code-coverage
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Sep 14, 2023
Rollup merge of rust-lang#115832 - Zalathar:fix-no-coverage, r=oli-obk

Fix the error message for `#![feature(no_coverage)]`

When rust-lang#114656 was written, the feature flag to replace `no_coverage` was originally spelled `coverage`, but it was eventually changed to `coverage_attribute` instead.

That update happened to miss this error message in `removed.rs`, and unfortunately I only noticed just *after* the original PR was approved and merged.

cc ``@bossmc`` (original author) ``@oli-obk`` (original reviewer)
``@rustbot`` label +A-code-coverage
zitsen added a commit to taosdata/taos-connector-rust that referenced this pull request Sep 15, 2023
kchibisov added a commit to kchibisov/calloop that referenced this pull request Sep 16, 2023
The way coverage is enabled/disabled was changed upstream.

Links: rust-lang/rust#114656
kchibisov added a commit to kchibisov/calloop that referenced this pull request Sep 16, 2023
The way coverage is enabled/disabled was changed upstream.

Links: rust-lang/rust#114656
kchibisov added a commit to kchibisov/calloop that referenced this pull request Sep 16, 2023
The way coverage is enabled/disabled was changed upstream.

Links: rust-lang/rust#114656
elinorbgr pushed a commit to Smithay/calloop that referenced this pull request Sep 18, 2023
The way coverage is enabled/disabled was changed upstream.

Links: rust-lang/rust#114656
vthib added a commit to vthib/boreal that referenced this pull request Sep 26, 2023
nightly has updated the coverage feature to coverage_attribute.
See rust-lang/rust#114656
vthib added a commit to vthib/boreal that referenced this pull request Sep 27, 2023
nightly has updated the coverage feature to coverage_attribute.
See rust-lang/rust#114656
LetsMelon added a commit to LetsMelon/rusvid that referenced this pull request Oct 13, 2023
Xuanwo pushed a commit to Xuanwo/reqsign that referenced this pull request Oct 27, 2023
* `rust-ini` 0.20 bumped `ordered-multimap` to 0.7
* `ordered-multimap 0.71` fixed a feature renaming
sgodwincs/ordered-multimap-rs@131ab56
* The feature renaming is required for downstream application to bump
nightly rust-toolchain. see
rust-lang/rust#114656

Please release a minor or patch version (both are OK because the update
only breaks nightly toolchain and affect nothing on stable toolchain)
after the PR got merged.

Signed-off-by: TennyZhuang <[email protected]>
@bossmc bossmc deleted the rework-no-coverage-attr branch January 9, 2024 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) merged-by-bors This PR was explicitly merged by bors. 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. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.