From 027126ce0b682367dc796c2cdcf844e162fca496 Mon Sep 17 00:00:00 2001 From: Jonathan Brouwer Date: Thu, 3 Jul 2025 09:10:49 +0200 Subject: Port `#[non_exhaustive]` to the new attribute parsing infrastructure --- compiler/rustc_attr_data_structures/src/attributes.rs | 3 +++ compiler/rustc_attr_data_structures/src/encode_cross_crate.rs | 1 + 2 files changed, 4 insertions(+) (limited to 'compiler/rustc_attr_data_structures/src') diff --git a/compiler/rustc_attr_data_structures/src/attributes.rs b/compiler/rustc_attr_data_structures/src/attributes.rs index 3b5e06c2a88..b5934f4e36e 100644 --- a/compiler/rustc_attr_data_structures/src/attributes.rs +++ b/compiler/rustc_attr_data_structures/src/attributes.rs @@ -284,6 +284,9 @@ pub enum AttributeKind { /// Represents `#[no_mangle]` NoMangle(Span), + /// Represents `#[non_exhaustive]` + NonExhaustive(Span), + /// Represents `#[optimize(size|speed)]` Optimize(OptimizeAttr, Span), diff --git a/compiler/rustc_attr_data_structures/src/encode_cross_crate.rs b/compiler/rustc_attr_data_structures/src/encode_cross_crate.rs index 145cfba8e42..02e95ddcb6f 100644 --- a/compiler/rustc_attr_data_structures/src/encode_cross_crate.rs +++ b/compiler/rustc_attr_data_structures/src/encode_cross_crate.rs @@ -36,6 +36,7 @@ impl AttributeKind { Naked(..) => No, NoImplicitPrelude(..) => No, NoMangle(..) => No, + NonExhaustive(..) => Yes, Optimize(..) => No, PassByValue(..) => Yes, PubTransparent(..) => Yes, -- cgit 1.4.1-3-g733a5