Skip to content

Commit d24ba16

Browse files
committed
Move inferred type example to an example block
This text really belonged with the introduction, since it isn't an explicit rule, but more of a commentary on how the inferred type is used.
1 parent b695e83 commit d24ba16

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/types/inferred.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ r[type.inferred.intro]
1010
The inferred type asks the compiler to infer the type if possible based on the
1111
surrounding information available.
1212

13-
r[type.inferred.constraint]
14-
It cannot be used in item signatures.
15-
16-
r[type.inferred.usage]
17-
It is often used in generic arguments:
13+
> [!EXAMPLE]
14+
> The inferred type is often used in generic arguments:
15+
>
16+
> ```rust
17+
> let x: Vec<_> = (0..10).collect();
18+
> ```
1819
19-
```rust
20-
let x: Vec<_> = (0..10).collect();
21-
```
20+
r[type.inferred.constraint]
21+
The inferred type cannot be used in item signatures.
2222
2323
<!--
2424
What else should be said here?

0 commit comments

Comments
 (0)