docs: note [*]T does not implicitly coerce to []T (slice with ptr[0..len])
This commit is contained in:
@@ -86,6 +86,10 @@ Options:
|
||||
| `struct`, `enum`, `union` | Composite types |
|
||||
| `Closure(args) -> ret` | Closure type |
|
||||
|
||||
A `[*]T` many-pointer carries no length, so it does **not** implicitly coerce to
|
||||
a slice `[]T` — slice it with a length: `ptr[0..len]`. (A fixed array `[N]T`
|
||||
*does* coerce to `[]T` — its length is known.)
|
||||
|
||||
**Numeric limits.** A field-like access on a builtin integer type name folds to
|
||||
a compile-time constant of that type: `i64.max` → `9223372036854775807`,
|
||||
`u8.min` → `0`, `i3.max` → `3`. It works for every width `i1`..`i64` / `u1`..`u64`
|
||||
|
||||
Reference in New Issue
Block a user