Skip to content

Commit a27746f

Browse files
committed
Revise type_length_limit text
1 parent 6d3c8ff commit a27746f

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/attributes/limits.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ r[attributes.limits.type_length_limit]
4444
## The `type_length_limit` attribute
4545

4646
r[attributes.limits.type_length_limit.intro]
47-
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.
4848

4949
> [!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.
5151
>
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).
5353
5454
> [!EXAMPLE]
5555
> <!-- ignore: not enforced without nightly flag -->
@@ -59,27 +59,28 @@ The *`type_length_limit` [attribute][attributes]* limits the maximum number of t
5959
> fn f<T>(x: T) {}
6060
>
6161
> // 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.
6364
> f(((((1,), 2), 3), 4));
6465
> ```
6566
6667
> [!NOTE]
67-
> The default in `rustc` is 1048576.
68+
> The default value in `rustc` is `1048576`.
6869
6970
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.
7172
7273
r[attributes.limits.type_length_limit.allowed-positions]
7374
The `type_length_limit` attribute may only be applied to the crate root.
7475
7576
> [!NOTE]
76-
> `rustc` currently warns in other positions, but this may be rejected in the future.
77+
> `rustc` ignores use in other positions but lints against it. This may become an error in the future.
7778
7879
r[attributes.limits.type_length_limit.duplicates]
79-
Only the first instance of `type_length_limit` on an item is honored. Subsequent `type_length_limit` attributes are ignored.
80+
Only the first use of `type_length_limit` on an item has effect.
8081
8182
> [!NOTE]
82-
> `rustc` currently warns on following duplicate `type_length_limit` attributes. This may become an error in the future.
83+
> `rustc` lints against use following the first. This may become an error in the future.
8384
8485
[attributes]: ../attributes.md
8586
[crate]: ../crates-and-source-files.md

0 commit comments

Comments
 (0)