Skip to content

Commit

Permalink
Merge pull request #1527 from compiler-errors/type-length-limit
Browse files Browse the repository at this point in the history
Suppress type length limit test and note that it is not enforced
  • Loading branch information
ehuss authored Jul 15, 2024
2 parents 2a79314 + 509c06e commit e2f0bdc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/attributes/limits.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,18 @@ a!{}

## The `type_length_limit` attribute

> **Note**: This limit is only enforced when the nightly `-Zenforce-type-length-limit` flag is active.
>
> For more information, see <https://github.com/rust-lang/rust/pull/127670>.
The *`type_length_limit` attribute* limits the maximum number of type
substitutions made when constructing a concrete type during monomorphization.
It is applied at the [crate] level, and uses the [_MetaNameValueStr_] syntax
to set the limit based on the number of type substitutions.

> Note: The default in `rustc` is 1048576.
```rust,compile_fail
```rust,ignore
#![type_length_limit = "4"]
fn f<T>(x: T) {}
Expand Down

0 comments on commit e2f0bdc

Please sign in to comment.