Skip to content

Commit 7453463

Browse files
Merge pull request #1026 from ehuss/fix-type-length-limit
Fix type_length_limit example.
2 parents 8bd12af + 8758f30 commit 7453463

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/attributes/limits.md

+4-9
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,14 @@ to set the limit based on the number of type substitutions.
4242

4343
> Note: The default in `rustc` is 1048576.
4444
45-
<!-- This code should fail to compile. Unfortunately rustdoc's `compile_fail`
46-
stops after analysis phase, and this error is generated after that. So
47-
this needs to be `ignore` for now. -->
48-
49-
```rust,compile_fail,ignore
50-
#![type_length_limit = "8"]
45+
```rust,compile_fail
46+
#![type_length_limit = "4"]
5147
5248
fn f<T>(x: T) {}
5349
5450
// This fails to compile because monomorphizing to
55-
// `f::<(i32, i32, i32, i32, i32, i32, i32, i32, i32)>>` requires more
56-
// than 8 type elements.
57-
f((1, 2, 3, 4, 5, 6, 7, 8, 9));
51+
// `f::<((((i32,), i32), i32), i32)>` requires more than 4 type elements.
52+
f(((((1,), 2), 3), 4));
5853
```
5954

6055
[_MetaNameValueStr_]: ../attributes.md#meta-item-attribute-syntax

0 commit comments

Comments
 (0)