Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress type length limit test and note that it is not enforced #1527

Merged
merged 2 commits into from
Jul 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Suppress type length limit test and note that it is not enforced
  • Loading branch information
compiler-errors committed Jul 14, 2024
commit 098ba7f86ec18efe9d7936b8742dabf889ce45cd
8 changes: 7 additions & 1 deletion src/attributes/limits.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 35,20 @@ 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
Loading