Skip to content

Commit 8f980cb

Browse files
committed
Add identifier syntax to attributes.limits
1 parent 42fbf9b commit 8f980cb

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/attributes/limits.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
# Limits
22

3+
r[attributes.limits]
4+
35
The following [attributes] affect compile-time limits.
46

57
## The `recursion_limit` attribute
68

9+
r[attributes.limits.recursion_limits]
10+
11+
r[attributes.limits.recursion_limits.application]
712
The *`recursion_limit` attribute* may be applied at the [crate] level to set the
813
maximum depth for potentially infinitely-recursive compile-time operations
9-
like macro expansion or auto-dereference. It uses the [_MetaNameValueStr_]
14+
like macro expansion or auto-dereference.
15+
16+
r[attributes.limits.recursion_limits.syntax]
17+
It uses the [_MetaNameValueStr_]
1018
syntax to specify the recursion depth.
1119

1220
> Note: The default in `rustc` is 128.
@@ -35,12 +43,17 @@ a!{}
3543

3644
## The `type_length_limit` attribute
3745

46+
r[attributes.limits.type_length_limit]
47+
3848
> **Note**: This limit is only enforced when the nightly `-Zenforce-type-length-limit` flag is active.
3949
>
4050
> For more information, see <https://github.com/rust-lang/rust/pull/127670>.
4151
52+
r[attributes.limits.type_length_limit.general]
4253
The *`type_length_limit` attribute* limits the maximum number of type
4354
substitutions made when constructing a concrete type during monomorphization.
55+
56+
r[attributes.limits.type_length_limit.restriction]
4457
It is applied at the [crate] level, and uses the [_MetaNameValueStr_] syntax
4558
to set the limit based on the number of type substitutions.
4659

0 commit comments

Comments
 (0)