Skip to content

Commit 83d0b93

Browse files
committed
clarify details of type marker
1 parent b96e2b7 commit 83d0b93

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

text/3838-scalable-vectors.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ the minimum number of elements the vector contains. For example:
142142

143143
```rust
144144
#[rustc_scalable_vector(4)]
145-
pub struct svfloat32_t { _ty: [f32], }
145+
pub struct svfloat32_t { _ty: &[f32], }
146146
```
147147

148148
As with the existing `repr(simd)`, `_ty` is purely a type marker, used to get
@@ -151,6 +151,17 @@ the element type for the codegen backend.
151151
`svfloat32_t` is a scalable vector with a minimum of four `f32` elements and
152152
potentially more depending on the length of the vector register at runtime.
153153

154+
`_ty` is purely a type marker, used to get the element type for the codegen
155+
backend. It must be an array slice containing one of the following types:
156+
157+
- `u8`, `u16`, `u32` or `u64`
158+
- `i8`, `i16`, `i32` or `i64`
159+
- `f16`, `f32` or `f64`
160+
- `bool`
161+
162+
It is not permitted to project into scalable vector types and access the type
163+
marker field.
164+
154165
## Choosing `N`
155166
[choosing-n]: #choosing-n
156167

0 commit comments

Comments
 (0)