Skip to content

Commit f5f99d4

Browse files
committed
Document inferred const args
1 parent 766bbd3 commit f5f99d4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/items/generics.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,22 @@ fn generic<const B: bool>() {
227227
}
228228
```
229229

230+
r[items.generics.const.inferred]
231+
232+
r[items.generics.const.inferred.syntax]
233+
```grammar,types
234+
@root InferredConst ->
235+
`_`
236+
| `(` InferredConst `)`
237+
```
238+
239+
r[items.generics.const.inferred.intro]
240+
The inferred const asks the compiler to infer the const argument if possible
241+
based on the surrounding information available.
242+
243+
r[items.generics.const.inferred.constraint]
244+
It cannot be used in item signatures.
245+
230246
r[items.generics.where]
231247
## Where clauses
232248

0 commit comments

Comments
 (0)