Skip to content

Commit 65b1ef1

Browse files
authored
Merge pull request #2019 from tshepang/patch-1
Move inferred sentence to an example block
2 parents 0f04386 + d24ba16 commit 65b1ef1

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/types/inferred.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +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-
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+
> ```
1719
18-
```rust
19-
let x: Vec<_> = (0..10).collect();
20-
```
20+
r[type.inferred.constraint]
21+
The inferred type cannot be used in item signatures.
2122
2223
<!--
2324
What else should be said here?

0 commit comments

Comments
 (0)