diff options
| author | Jonathan Brouwer <jonathantbrouwer@gmail.com> | 2025-07-04 12:42:33 +0200 |
|---|---|---|
| committer | Jonathan Brouwer <jonathantbrouwer@gmail.com> | 2025-07-06 09:51:35 +0200 |
| commit | 3fa0ec91d8f3f14f9514d45d93e6fb7fdf1ad89e (patch) | |
| tree | 66df20bec1d1c6d142db768c438968e4001ebe73 /compiler/rustc_attr_data_structures/src | |
| parent | febb10d0a2d29278135676783f6a22eb83295981 (diff) | |
| download | rust-3fa0ec91d8f3f14f9514d45d93e6fb7fdf1ad89e.tar.gz rust-3fa0ec91d8f3f14f9514d45d93e6fb7fdf1ad89e.zip | |
Rewrite empty attribute lint
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
Diffstat (limited to 'compiler/rustc_attr_data_structures/src')
| -rw-r--r-- | compiler/rustc_attr_data_structures/src/attributes.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_attr_data_structures/src/encode_cross_crate.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_attr_data_structures/src/lints.rs | 1 |
3 files changed, 3 insertions, 4 deletions
diff --git a/compiler/rustc_attr_data_structures/src/attributes.rs b/compiler/rustc_attr_data_structures/src/attributes.rs index 6af15da7d08..ba62be676d4 100644 --- a/compiler/rustc_attr_data_structures/src/attributes.rs +++ b/compiler/rustc_attr_data_structures/src/attributes.rs @@ -67,8 +67,6 @@ pub enum ReprAttr { ReprSimd, ReprTransparent, ReprAlign(Align), - // this one is just so we can emit a lint for it - ReprEmpty, } pub use ReprAttr::*; @@ -304,7 +302,7 @@ pub enum AttributeKind { PubTransparent(Span), /// Represents [`#[repr]`](https://doc.rust-lang.org/stable/reference/type-layout.html#representations). - Repr(ThinVec<(ReprAttr, Span)>), + Repr { reprs: ThinVec<(ReprAttr, Span)>, first_span: Span }, /// Represents `#[rustc_layout_scalar_valid_range_end]`. RustcLayoutScalarValidRangeEnd(Box<u128>, 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 8ebd38a6ba7..b109ebbf47b 100644 --- a/compiler/rustc_attr_data_structures/src/encode_cross_crate.rs +++ b/compiler/rustc_attr_data_structures/src/encode_cross_crate.rs @@ -41,7 +41,7 @@ impl AttributeKind { Optimize(..) => No, PassByValue(..) => Yes, PubTransparent(..) => Yes, - Repr(..) => No, + Repr { .. } => No, RustcLayoutScalarValidRangeEnd(..) => Yes, RustcLayoutScalarValidRangeStart(..) => Yes, RustcObjectLifetimeDefault => No, diff --git a/compiler/rustc_attr_data_structures/src/lints.rs b/compiler/rustc_attr_data_structures/src/lints.rs index e34c54c6d32..60ca4d43ce9 100644 --- a/compiler/rustc_attr_data_structures/src/lints.rs +++ b/compiler/rustc_attr_data_structures/src/lints.rs @@ -12,4 +12,5 @@ pub struct AttributeLint<Id> { pub enum AttributeLintKind { UnusedDuplicate { this: Span, other: Span, warning: bool }, IllFormedAttributeInput { suggestions: Vec<String> }, + EmptyAttribute { first_span: Span }, } |
