Rollup merge of #142539 - GrigorenkoPV:attributes/may_dangle, r=jdonszelmann

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

Very similar to rust-lang/rust#142498.

This is a part of rust-lang/rust#131229, so
r? `@jdonszelmann`
This commit is contained in:
Jana Dönszelmann
2025-06-21 15:32:05 +02:00
committed by GitHub
6 changed files with 33 additions and 3 deletions

View File

@@ -233,8 +233,13 @@ pub enum AttributeKind {
/// Represents `#[rustc_macro_transparency]`.
MacroTransparency(Transparency),
/// Represents [`#[may_dangle]`](https://std-dev-guide.rust-lang.org/tricky/may-dangle.html).
MayDangle(Span),
/// Represents `#[optimize(size|speed)]`
Optimize(OptimizeAttr, Span),
/// Represents [`#[repr]`](https://doc.rust-lang.org/stable/reference/type-layout.html#representations).
Repr(ThinVec<(ReprAttr, Span)>),