Rollup merge of #143891 - scrabsha:push-xxtttopqoprr, r=jdonszelmann

Port `#[coverage]` to the new attribute system

r? ``````@jdonszelmann``````
This commit is contained in:
Matthias Krüger
2025-07-18 04:27:52 +02:00
committed by GitHub
17 changed files with 434 additions and 462 deletions

View File

@@ -110,6 +110,22 @@ pub enum DeprecatedSince {
Err,
}
#[derive(
Copy,
Debug,
Eq,
PartialEq,
Encodable,
Decodable,
Clone,
HashStable_Generic,
PrintAttribute
)]
pub enum CoverageStatus {
On,
Off,
}
impl Deprecation {
/// Whether an item marked with #[deprecated(since = "X")] is currently
/// deprecated (i.e., whether X is not greater than the current rustc
@@ -274,6 +290,9 @@ pub enum AttributeKind {
/// Represents `#[const_trait]`.
ConstTrait(Span),
/// Represents `#[coverage]`.
Coverage(Span, CoverageStatus),
///Represents `#[rustc_deny_explicit_impl]`.
DenyExplicitImpl(Span),

View File

@@ -28,6 +28,7 @@ impl AttributeKind {
ConstStability { .. } => Yes,
ConstStabilityIndirect => No,
ConstTrait(..) => No,
Coverage(..) => No,
DenyExplicitImpl(..) => No,
Deprecation { .. } => Yes,
DoNotImplementViaObject(..) => No,