You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The *`type_length_limit`[attribute][attributes]*limits the maximum number of type substitutions made when constructing a concrete type during monomorphization.
47
+
The *`type_length_limit`[attribute][attributes]*sets the maximum number of type substitutions allowed when constructing a concrete type during monomorphization.
48
48
49
49
> [!NOTE]
50
-
> In `rustc`this limit is only enforced when the nightly `-Zenforce-type-length-limit` flag is active.
50
+
> `rustc`only enforces the limit when the nightly `-Zenforce-type-length-limit` flag is active.
51
51
>
52
-
> For more information, see <https://github.com/rust-lang/rust/pull/127670>.
52
+
> For more information, see [Rust PR #127670](https://github.com/rust-lang/rust/pull/127670).
53
53
54
54
> [!EXAMPLE]
55
55
> <!-- ignore: not enforced without nightly flag -->
@@ -59,27 +59,28 @@ The *`type_length_limit` [attribute][attributes]* limits the maximum number of t
59
59
> fn f<T>(x: T) {}
60
60
>
61
61
> // This fails to compile because monomorphizing to
62
-
> // `f::<((((i32,), i32), i32), i32)>` requires more than 4 type elements.
62
+
> // `f::<((((i32,), i32), i32), i32)>` requires more
63
+
> // than 4 type elements.
63
64
> f(((((1,), 2), 3), 4));
64
65
> ```
65
66
66
67
> [!NOTE]
67
-
> The default in `rustc` is 1048576.
68
+
> The default value in `rustc` is `1048576`.
68
69
69
70
r[attributes.limits.type_length_limit.syntax]
70
-
The `type_length_limit` attribute uses the [MetaNameValueStr] syntax to set the limit. The value in the string must be a non-negative number.
71
+
The `type_length_limit` attribute uses the [MetaNameValueStr] syntax. The value in the string must be a non-negative number.
0 commit comments