diff options
| author | Jana Dönszelmann <jana@donsz.nl> | 2025-08-24 10:56:41 +0200 |
|---|---|---|
| committer | Jana Dönszelmann <jana@donsz.nl> | 2025-09-08 14:57:28 -0700 |
| commit | 92f24020967e4e1f1375dbb2d1ba85cd4430fc78 (patch) | |
| tree | b33c126439de4bbf1182cbd73f46aedf7a1ed391 /compiler/rustc_hir/src | |
| parent | a78f9aa87fa828ad4a5c11f1e3b93e94d9352ad6 (diff) | |
| download | rust-92f24020967e4e1f1375dbb2d1ba85cd4430fc78.tar.gz rust-92f24020967e4e1f1375dbb2d1ba85cd4430fc78.zip | |
port `#[recursion_limit]` to the new attribute parsing infrastructure
Diffstat (limited to 'compiler/rustc_hir/src')
| -rw-r--r-- | compiler/rustc_hir/src/attrs/data_structures.rs | 3 | ||||
| -rw-r--r-- | compiler/rustc_hir/src/attrs/encode_cross_crate.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_hir/src/attrs/pretty_printing.rs | 2 |
3 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_hir/src/attrs/data_structures.rs b/compiler/rustc_hir/src/attrs/data_structures.rs index dd5565d6f90..bfc7613342a 100644 --- a/compiler/rustc_hir/src/attrs/data_structures.rs +++ b/compiler/rustc_hir/src/attrs/data_structures.rs @@ -611,6 +611,9 @@ pub enum AttributeKind { /// Represents `#[rustc_pub_transparent]` (used by the `repr_transparent_external_private_fields` lint). PubTransparent(Span), + /// Represents [`#[recursion_limit]`](https://doc.rust-lang.org/reference/attributes/limits.html#the-recursion_limit-attribute) + RecursionLimit { attr_span: Span, limit_span: Span, limit: usize }, + /// Represents [`#[repr]`](https://doc.rust-lang.org/stable/reference/type-layout.html#representations). Repr { reprs: ThinVec<(ReprAttr, Span)>, first_span: Span }, diff --git a/compiler/rustc_hir/src/attrs/encode_cross_crate.rs b/compiler/rustc_hir/src/attrs/encode_cross_crate.rs index 3810bb6d003..26929e805a5 100644 --- a/compiler/rustc_hir/src/attrs/encode_cross_crate.rs +++ b/compiler/rustc_hir/src/attrs/encode_cross_crate.rs @@ -75,6 +75,7 @@ impl AttributeKind { ProcMacroAttribute(..) => No, ProcMacroDerive { .. } => No, PubTransparent(..) => Yes, + RecursionLimit { .. } => No, Repr { .. } => No, RustcBuiltinMacro { .. } => Yes, RustcLayoutScalarValidRangeEnd(..) => Yes, diff --git a/compiler/rustc_hir/src/attrs/pretty_printing.rs b/compiler/rustc_hir/src/attrs/pretty_printing.rs index e65de25b451..a4c2beb689d 100644 --- a/compiler/rustc_hir/src/attrs/pretty_printing.rs +++ b/compiler/rustc_hir/src/attrs/pretty_printing.rs @@ -146,7 +146,7 @@ macro_rules! print_tup { print_tup!(A B C D E F G H); print_skip!(Span, (), ErrorGuaranteed); -print_disp!(u16, bool, NonZero<u32>); +print_disp!(u16, bool, NonZero<u32>, usize); print_debug!( Symbol, Ident, |
