diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2024-10-31 02:32:34 +0000 |
|---|---|---|
| committer | mlugg <mlugg@mlugg.co.uk> | 2024-10-31 20:42:53 +0000 |
| commit | 24babde746621492c5111ffcd8edf575cb176d65 (patch) | |
| tree | c5f7affd52d47632874da1f533c888ef648e8304 /src/Zcu/PerThread.zig | |
| parent | d11bbde5f9c64ef58405604601d55f88bb5d5f3a (diff) | |
| download | zig-24babde746621492c5111ffcd8edf575cb176d65.tar.gz zig-24babde746621492c5111ffcd8edf575cb176d65.zip | |
std.mem.asBytes: fix footgun when passing non-single pointer
I was just bitten by this footgun, where I actually wanted
`sliceAsBytes` but unintentionally used `asBytes`, which in practice
ignored all but the first element. Just add a comptime assertion to
trigger a compile error in this case.
Diffstat (limited to 'src/Zcu/PerThread.zig')
0 files changed, 0 insertions, 0 deletions
