Uh oh!
There was an error while loading. Please reload this page.
Disallows #![feature(no_coverage)] on stable and beta (using standard crate-level gating) - #84871
Conversation
0c51f39 to
f5b0874Compare
This comment has been minimized.
This comment has been minimized.
f5b0874 to
90204feCompare
This comment has been minimized.
This comment has been minimized.
90204fe to
a40d701Compare
This comment has been minimized.
This comment has been minimized.
ghost
commented
May 3, 2021
This does not seem like what's described in #84836 (comment) (emphasis mine)?
The macro generates |
richkadel
commented
May 3, 2021
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. |
tmandry
commented
May 5, 2021
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 |
Uh oh!
There was an error while loading. Please reload this page.
richkadel
commented
May 5, 2021
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 |
There was a problem hiding this comment.
This doesn't need to be conditional on is_nightly_build, does it?
There was a problem hiding this comment.
I'll try to change it and verify it still builds core and still disables use on beta/stable.
nagisa
commented
May 5, 2021
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 betarichkadel
commented
May 5, 2021
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
3584c1dComparerichkadel
commented
May 5, 2021
@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+ |
bors
commented
May 5, 2021
📌 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)richkadel
commented
May 5, 2021
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
emilyalbini
commented
May 7, 2021
My understanding is that this should be backported to 1.53 beta, correct? |
wesleywiser
commented
May 7, 2021
Yes, nominating for beta-backport. |
pnkfelix
commented
May 13, 2021
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=1With unstable features disabled, I get the expected result as shown here:
r? @Mark-Simulacrum
cc: @tmandry@wesleywiser