-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Disallows #![feature(no_coverage)]
on stable and beta (using standard crate-level gating)
#84871
Conversation
0c51f39
to
f5b0874
Compare
This comment has been minimized.
This comment has been minimized.
f5b0874
to
90204fe
Compare
This comment has been minimized.
This comment has been minimized.
90204fe
to
a40d701
Compare
This comment has been minimized.
This comment has been minimized.
This does not seem like what's described in #84836 (comment) (emphasis mine)?
The macro generates |
No, probably not. I don't fully understand the option Mark described, and I'm not sure if it's a general solution, or one that will only work for the But this solution has the desired effect. |
This will work for now but given #84836 (comment) I don't think we should continue using this mechanism without an MCP. This wouldn't work anyway if we decided to stabilize |
I just uploaded a revised implementation that I believe meets everyone's expectations. Per @nagisa 's hints, I figured out how to apply the feature gating at the crate level, and used I updated the Tests with |
cx.attribute(doc), | ||
]; | ||
let mut attrs = vec![cx.attribute(inline), cx.attribute(doc)]; | ||
if cx.parse_sess().unstable_features.is_nightly_build() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't need to be conditional on is_nightly_build
, does it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll try to change it and verify it still builds core
and still disables use on beta/stable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Can you adjust the description and the title of the PR please? |
#[feature(no_coverage)]
on stable and beta#![feature(no_coverage)]
on stable and beta
I added an exclamation point to the attribute in the title. The description looks fine to me. (I had already removed the function-level example.) Let me know if I'm missing something. |
using allow_internal_unstable (as recommended) Fixes: rust-lang#84836 ```shell $ ./build/x86_64-unknown-linux-gnu/stage1/bin/rustc src/test/run-make-fulldeps/coverage/no_cov_crate.rs error[E0554]: `#![feature]` may not be used on the dev release channel --> src/test/run-make-fulldeps/coverage/no_cov_crate.rs:2:1 | 2 | #![feature(no_coverage)] | ^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error For more information about this error, try `rustc --explain E0554`. ```
22b355a
to
3584c1d
Compare
@nagisa - I think this is ready:
Thanks |
Ah, I meant that its no longer precisely about disallowing the attribute on stable/beta (in particular no code specifically addresses this particular point) but more like making @bors r+ |
📌 Commit 3584c1d has been approved by |
#![feature(no_coverage)]
on stable and beta#![feature(no_coverage)]
on stable and beta (using standard crate-level gating)
Oh, I gotcha. Done. |
…, r=nagisa Disallows `#![feature(no_coverage)]` on stable and beta (using standard crate-level gating) Fixes: rust-lang#84836 Removes the function-level feature gating solution originally implemented, and solves the same problem using `allow_internal_unstable`, so normal crate-level feature gating mechanism can still be used (which disallows the feature on stable and beta). I tested this, building the compiler with and without `CFG_DISABLE_UNSTABLE_FEATURES=1` With unstable features disabled, I get the expected result as shown here: ```shell $ ./build/x86_64-unknown-linux-gnu/stage1/bin/rustc src/test/run-make-fulldeps/coverage/no_cov_crate.rs error[E0554]: `#![feature]` may not be used on the dev release channel --> src/test/run-make-fulldeps/coverage/no_cov_crate.rs:2:1 | 2 | #![feature(no_coverage)] | ^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error For more information about this error, try `rustc --explain E0554`. ``` r? `@Mark-Simulacrum` cc: `@tmandry` `@wesleywiser`
…, r=nagisa Disallows `#![feature(no_coverage)]` on stable and beta (using standard crate-level gating) Fixes: rust-lang#84836 Removes the function-level feature gating solution originally implemented, and solves the same problem using `allow_internal_unstable`, so normal crate-level feature gating mechanism can still be used (which disallows the feature on stable and beta). I tested this, building the compiler with and without `CFG_DISABLE_UNSTABLE_FEATURES=1` With unstable features disabled, I get the expected result as shown here: ```shell $ ./build/x86_64-unknown-linux-gnu/stage1/bin/rustc src/test/run-make-fulldeps/coverage/no_cov_crate.rs error[E0554]: `#![feature]` may not be used on the dev release channel --> src/test/run-make-fulldeps/coverage/no_cov_crate.rs:2:1 | 2 | #![feature(no_coverage)] | ^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error For more information about this error, try `rustc --explain E0554`. ``` r? ``@Mark-Simulacrum`` cc: ``@tmandry`` ``@wesleywiser``
…, r=nagisa Disallows `#![feature(no_coverage)]` on stable and beta (using standard crate-level gating) Fixes: rust-lang#84836 Removes the function-level feature gating solution originally implemented, and solves the same problem using `allow_internal_unstable`, so normal crate-level feature gating mechanism can still be used (which disallows the feature on stable and beta). I tested this, building the compiler with and without `CFG_DISABLE_UNSTABLE_FEATURES=1` With unstable features disabled, I get the expected result as shown here: ```shell $ ./build/x86_64-unknown-linux-gnu/stage1/bin/rustc src/test/run-make-fulldeps/coverage/no_cov_crate.rs error[E0554]: `#![feature]` may not be used on the dev release channel --> src/test/run-make-fulldeps/coverage/no_cov_crate.rs:2:1 | 2 | #![feature(no_coverage)] | ^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error For more information about this error, try `rustc --explain E0554`. ``` r? ```@Mark-Simulacrum``` cc: ```@tmandry``` ```@wesleywiser```
Rollup of 11 pull requests Successful merges: - rust-lang#84409 (Ensure TLS destructors run before thread joins in SGX) - rust-lang#84500 (Add --run flag to compiletest) - rust-lang#84728 (Add test for suggestion to borrow unsized function parameters) - rust-lang#84734 (Add `needs-unwind` and beginning of support for testing `panic=abort` std to compiletest) - rust-lang#84755 (Allow using `core::` in intra-doc links within core itself) - rust-lang#84871 (Disallows `#![feature(no_coverage)]` on stable and beta (using standard crate-level gating)) - rust-lang#84872 (Wire up tidy dependency checks for cg_clif) - rust-lang#84896 (Handle incorrect placement of parentheses in trait bounds more gracefully) - rust-lang#84905 (CTFE engine: rename copy → copy_intrinsic, move to intrinsics.rs) - rust-lang#84953 (Remove unneeded call to with_default_session_globals in rustdoc highlight) - rust-lang#84987 (small nits) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
My understanding is that this should be backported to 1.53 beta, correct? |
Yes, nominating for beta-backport. |
discussed in T-compiler meeting, beta backport approved. |
…ulacrum [beta] backports * Backport 1.52.1 release notes rust-lang#85404 * remove InPlaceIterable marker from Peekable due to unsoundness rust-lang#85340 * rustdoc: Call initSidebarItems in root module of crate rust-lang#85304 * Update LLVM submodule rust-lang#85236 * Do not ICE on invalid const param rust-lang#84913 * Disallows #![feature(no_coverage)] on stable and beta (using standard crate-level gating) rust-lang#84871 * Ensure TLS destructors run before thread joins in SGX rust-lang#84409
Fixes: #84836
Removes the function-level feature gating solution originally implemented, and solves the same problem using
allow_internal_unstable
, so normal crate-level feature gating mechanism can still be used (which disallows the feature on stable and beta).I tested this, building the compiler with and without
CFG_DISABLE_UNSTABLE_FEATURES=1
With unstable features disabled, I get the expected result as shown here:
r? @Mark-Simulacrum
cc: @tmandry @wesleywiser