diff options
| author | xackus <14938807+xackus@users.noreply.github.com> | 2020-11-16 12:50:05 +0100 |
|---|---|---|
| committer | xackus <14938807+xackus@users.noreply.github.com> | 2020-11-16 12:50:05 +0100 |
| commit | 109a3ebcca2928b1d5f40accab9a8b6a03ea750b (patch) | |
| tree | 656c54beaeeea6d41f5bdeb6eb79f3b09ac47278 /lib/std | |
| parent | 92e45ee3a18cd88e90aedef467a2d203d9b330c2 (diff) | |
| download | zig-109a3ebcca2928b1d5f40accab9a8b6a03ea750b.tar.gz zig-109a3ebcca2928b1d5f40accab9a8b6a03ea750b.zip | |
std.mem: make args comptime, fix test names
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/mem.zig | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/std/mem.zig b/lib/std/mem.zig index 94f1f71540..fecce180fc 100644 --- a/lib/std/mem.zig +++ b/lib/std/mem.zig @@ -1937,7 +1937,7 @@ pub fn nativeToBig(comptime T: type, x: T) T { }; } -fn CopyPtrAttrs(comptime source: type, size: builtin.TypeInfo.Pointer.Size, child: type) type { +fn CopyPtrAttrs(comptime source: type, comptime size: builtin.TypeInfo.Pointer.Size, comptime child: type) type { const info = @typeInfo(source).Pointer; return @Type(.{ .Pointer = .{ @@ -2001,7 +2001,7 @@ test "asBytes" { testing.expect(eql(u8, asBytes(&zero), "")); } -test "asBytes preserves qualifiers" { +test "asBytes preserves pointer attributes" { const inArr: u32 align(16) = 0xDEADBEEF; const inPtr = @ptrCast(*align(16) const volatile u32, &inArr); const outSlice = asBytes(inPtr); @@ -2090,7 +2090,7 @@ test "bytesAsValue" { testing.expect(meta.eql(inst, inst2.*)); } -test "bytesAsValue preserves qualifiers" { +test "bytesAsValue preserves pointer attributes" { const inArr align(16) = [4]u8{ 0xDE, 0xAD, 0xBE, 0xEF }; const inSlice = @ptrCast(*align(16) const volatile [4]u8, &inArr)[0..]; const outPtr = bytesAsValue(u32, inSlice); @@ -2198,7 +2198,7 @@ test "bytesAsSlice with specified alignment" { testing.expect(slice[0] == 0x33333333); } -test "bytesAsSlice preserves qualifiers" { +test "bytesAsSlice preserves pointer attributes" { const inArr align(16) = [4]u8{ 0xDE, 0xAD, 0xBE, 0xEF }; const inSlice = @ptrCast(*align(16) const volatile [4]u8, &inArr)[0..]; const outSlice = bytesAsSlice(u16, inSlice); @@ -2302,7 +2302,7 @@ test "sliceAsBytes and bytesAsSlice back" { testing.expect(bytes[11] == math.maxInt(u8)); } -test "sliceAsBytes preserves qualifiers" { +test "sliceAsBytes preserves pointer attributes" { const inArr align(16) = [2]u16{ 0xDEAD, 0xBEEF }; const inSlice = @ptrCast(*align(16) const volatile [2]u16, &inArr)[0..]; const outSlice = sliceAsBytes(inSlice); |
