@@ -4,10 +4,12 @@ The following [attributes] affect compile-time limits.
4
4
5
5
## The ` recursion_limit ` attribute
6
6
7
- The * ` recursion_limit ` attribute* may be applied at the crate level to set the
7
+ The * ` recursion_limit ` attribute* may be applied at the [ crate] level to set the
8
8
maximum depth for potentially infinitely-recursive compile-time operations
9
9
like auto-dereference or macro expansion. It uses the [ _ MetaNameValueStr_ ]
10
- syntax to specify the recursion depth. The default is 64.
10
+ syntax to specify the recursion depth.
11
+
12
+ > Note: The default in ` rustc ` is 64.
11
13
12
14
``` rust,ignore
13
15
#![recursion_limit = "4"]
26
28
27
29
## The ` type_length_limit ` attribute
28
30
29
- The * ` type_length_limit ` attribute* limits the maximum size of a type
30
- constructed during monomorphization. It is applied at the crate level, and
31
- uses the [ _ MetaNameValueStr_ ] syntax to set the limit based on the number of
32
- type substitutions within the type. The default value is 1048576.
31
+ The * ` type_length_limit ` attribute* limits the maximum number of type
32
+ substitutions made when constructing a concrete type during monomorphization.
33
+ It is applied at the [ crate] level, and uses the [ _ MetaNameValueStr_ ] syntax
34
+ to set the limit based on the number of type substitutions.
35
+
36
+ > Note: The default in ` rustc ` is 1048576.
33
37
34
38
``` rust,ignore
35
39
#![type_length_limit = "8"]
@@ -44,5 +48,6 @@ struct C;
44
48
drop::<Option<A>>(None);
45
49
```
46
50
47
- [ attributes ] : attributes.html
48
51
[ _MetaNameValueStr_ ] : attributes.html#meta-item-attribute-syntax
52
+ [ attributes ] : attributes.html
53
+ [ crate ] : crates-and-source-files.html
0 commit comments