authorgravatar for 14938807+xackus@users.noreply.github.comxackus <14938807+xackus@users.noreply.github.com> 2020-11-16 12:50:05+01:00
committergravatar for 14938807+xackus@users.noreply.github.comxackus <14938807+xackus@users.noreply.github.com> 2020-11-16 12:50:05+01:00
log109a3ebcca2928b1d5f40accab9a8b6a03ea750b
tree656c54beaeeea6d41f5bdeb6eb79f3b09ac47278
parent92e45ee3a18cd88e90aedef467a2d203d9b330c2

std.mem: make args comptime, fix test names


1 files changed, 5 insertions(+), 5 deletions(-)

lib/std/mem.zig+5-5
......@@ -1937,7 +1937,7 @@ pub fn nativeToBig(comptime T: type, x: T) T {
19371937 };
19381938}
19391939
1940fn CopyPtrAttrs(comptime source: type, size: builtin.TypeInfo.Pointer.Size, child: type) type {
1940fn CopyPtrAttrs(comptime source: type, comptime size: builtin.TypeInfo.Pointer.Size, comptime child: type) type {
19411941 const info = @typeInfo(source).Pointer;
19421942 return @Type(.{
19431943 .Pointer = .{
......@@ -2001,7 +2001,7 @@ test "asBytes" {
20012001 testing.expect(eql(u8, asBytes(&zero), ""));
20022002}
20032003
2004test "asBytes preserves qualifiers" {
2004test "asBytes preserves pointer attributes" {
20052005 const inArr: u32 align(16) = 0xDEADBEEF;
20062006 const inPtr = @ptrCast(*align(16) const volatile u32, &inArr);
20072007 const outSlice = asBytes(inPtr);
......@@ -2090,7 +2090,7 @@ test "bytesAsValue" {
20902090 testing.expect(meta.eql(inst, inst2.*));
20912091}
20922092
2093test "bytesAsValue preserves qualifiers" {
2093test "bytesAsValue preserves pointer attributes" {
20942094 const inArr align(16) = [4]u8{ 0xDE, 0xAD, 0xBE, 0xEF };
20952095 const inSlice = @ptrCast(*align(16) const volatile [4]u8, &inArr)[0..];
20962096 const outPtr = bytesAsValue(u32, inSlice);
......@@ -2198,7 +2198,7 @@ test "bytesAsSlice with specified alignment" {
21982198 testing.expect(slice[0] == 0x33333333);
21992199}
22002200
2201test "bytesAsSlice preserves qualifiers" {
2201test "bytesAsSlice preserves pointer attributes" {
22022202 const inArr align(16) = [4]u8{ 0xDE, 0xAD, 0xBE, 0xEF };
22032203 const inSlice = @ptrCast(*align(16) const volatile [4]u8, &inArr)[0..];
22042204 const outSlice = bytesAsSlice(u16, inSlice);
......@@ -2302,7 +2302,7 @@ test "sliceAsBytes and bytesAsSlice back" {
23022302 testing.expect(bytes[11] == math.maxInt(u8));
23032303}
23042304
2305test "sliceAsBytes preserves qualifiers" {
2305test "sliceAsBytes preserves pointer attributes" {
23062306 const inArr align(16) = [2]u16{ 0xDEAD, 0xBEEF };
23072307 const inSlice = @ptrCast(*align(16) const volatile [2]u16, &inArr)[0..];
23082308 const outSlice = sliceAsBytes(inSlice);