rust/compiler/rustc_feature/src
Dylan DPC aaf23892ab
Rollup merge of #84871 - richkadel:no-coverage-unstable-only, r=nagisa
Disallows `#![feature(no_coverage)]` on stable and beta (using standard crate-level gating)

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:

```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````
2021-05-07 00:38:40 +02:00
..
accepted.rs Stablize non_ascii_idents feature. 2021-04-08 02:52:00 +08:00
active.rs Implement RFC 2951: Native link modifiers 2021-05-05 16:04:25 -07:00
builtin_attrs.rs Disallows #![feature(no_coverage)] on stable and beta 2021-05-05 07:52:26 -07:00
lib.rs Fix outdated crate names in compiler docs 2021-04-08 11:12:14 -05:00
removed.rs Add pub_macro_rules to the list of removed features 2021-04-23 10:58:07 -03:00
tests.rs tidy: Re-enable check for inline unit tests 2020-12-12 19:18:44 +03:00