| ... | ... | @@ -1937,7 +1937,7 @@ pub fn nativeToBig(comptime T: type, x: T) T { |
| 1937 | 1937 | }; |
| 1938 | 1938 | } |
| 1939 | 1939 | |
| 1940 | | fn CopyPtrAttrs(comptime source: type, size: builtin.TypeInfo.Pointer.Size, child: type) type { |
| 1940 | fn CopyPtrAttrs(comptime source: type, comptime size: builtin.TypeInfo.Pointer.Size, comptime child: type) type { |
| 1941 | 1941 | const info = @typeInfo(source).Pointer; |
| 1942 | 1942 | return @Type(.{ |
| 1943 | 1943 | .Pointer = .{ |
| ... | ... | @@ -2001,7 +2001,7 @@ test "asBytes" { |
| 2001 | 2001 | testing.expect(eql(u8, asBytes(&zero), "")); |
| 2002 | 2002 | } |
| 2003 | 2003 | |
| 2004 | | test "asBytes preserves qualifiers" { |
| 2004 | test "asBytes preserves pointer attributes" { |
| 2005 | 2005 | const inArr: u32 align(16) = 0xDEADBEEF; |
| 2006 | 2006 | const inPtr = @ptrCast(*align(16) const volatile u32, &inArr); |
| 2007 | 2007 | const outSlice = asBytes(inPtr); |
| ... | ... | @@ -2090,7 +2090,7 @@ test "bytesAsValue" { |
| 2090 | 2090 | testing.expect(meta.eql(inst, inst2.*)); |
| 2091 | 2091 | } |
| 2092 | 2092 | |
| 2093 | | test "bytesAsValue preserves qualifiers" { |
| 2093 | test "bytesAsValue preserves pointer attributes" { |
| 2094 | 2094 | const inArr align(16) = [4]u8{ 0xDE, 0xAD, 0xBE, 0xEF }; |
| 2095 | 2095 | const inSlice = @ptrCast(*align(16) const volatile [4]u8, &inArr)[0..]; |
| 2096 | 2096 | const outPtr = bytesAsValue(u32, inSlice); |
| ... | ... | @@ -2198,7 +2198,7 @@ test "bytesAsSlice with specified alignment" { |
| 2198 | 2198 | testing.expect(slice[0] == 0x33333333); |
| 2199 | 2199 | } |
| 2200 | 2200 | |
| 2201 | | test "bytesAsSlice preserves qualifiers" { |
| 2201 | test "bytesAsSlice preserves pointer attributes" { |
| 2202 | 2202 | const inArr align(16) = [4]u8{ 0xDE, 0xAD, 0xBE, 0xEF }; |
| 2203 | 2203 | const inSlice = @ptrCast(*align(16) const volatile [4]u8, &inArr)[0..]; |
| 2204 | 2204 | const outSlice = bytesAsSlice(u16, inSlice); |
| ... | ... | @@ -2302,7 +2302,7 @@ test "sliceAsBytes and bytesAsSlice back" { |
| 2302 | 2302 | testing.expect(bytes[11] == math.maxInt(u8)); |
| 2303 | 2303 | } |
| 2304 | 2304 | |
| 2305 | | test "sliceAsBytes preserves qualifiers" { |
| 2305 | test "sliceAsBytes preserves pointer attributes" { |
| 2306 | 2306 | const inArr align(16) = [2]u16{ 0xDEAD, 0xBEEF }; |
| 2307 | 2307 | const inSlice = @ptrCast(*align(16) const volatile [2]u16, &inArr)[0..]; |
| 2308 | 2308 | const outSlice = sliceAsBytes(inSlice); |