Skip to content

Commit ea9dc7a

Browse files
committed
Revise a bit editorially
1 parent 0ae56c2 commit ea9dc7a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/items/generics.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,11 +237,12 @@ InferredConst ->
237237
```
238238

239239
r[items.generics.const.inferred.intro]
240-
The inferred const asks the compiler to infer the const argument if possible based on the surrounding information available.
240+
Where a const argument is expected, an `_` (optionally surrounding by any number of matching parentheses), called the "inferred const", can be used instead. This asks the compiler to infer the const argument if possible based on surrounding information.
241241

242242
```rust
243243
fn make_buf() -> [u8; 1024] {
244244
[0x1; _]
245+
// ^ Infers `1024`.
245246
}
246247
```
247248

0 commit comments

Comments
 (0)