You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since "namespace" has a specific meaning in Rust, I feel like it would
be good not to overload it too much with the sense of a scope container
like a C++ namespace.
Copy file name to clipboardExpand all lines: src/items/generics.md
+4-7Lines changed: 4 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,12 +46,8 @@ referred to with path syntax.
46
46
47
47
### Const generics
48
48
49
-
*Const generic parameters* allow items to be generic over constant values. The
50
-
const identifier introduces a name for the constant parameter, and all
51
-
instances of the item must be instantiated with a value of the given type.
52
-
53
-
<!-- TODO: update above to say "introduces a name in the [value namespace]"
54
-
once namespaces are added. -->
49
+
*Const generic parameters* allow items to be generic over constant values.
50
+
The const identifier introduces a name in the [value namespace] for the constant parameter, and all instances of the item must be instantiated with a value of the given type.
55
51
56
52
The only allowed types of const parameters are `u8`, `u16`, `u32`, `u64`, `u128`, `usize`,
57
53
`i8`, `i16`, `i32`, `i64`, `i128`, `isize`, `char` and `bool`.
0 commit comments