zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 37bc6ee54a388717095ab59959e5b0282d1ef8ef (tree)
parent f2cb63c2e1a08db4ac29de3db1bf5b4d28a11e92
Author: Frank Denis <github@pureftpd.org>
Date:   Tue,  3 Nov 2020 20:10:02 +0100

std.meta: test that const and mut variables have different addresses

We are checking that two identical, constant values, are stored at
different addresses.

But sharing a unique location doesn't look like something the compiler
wouldn't do.

It may make more sense to check that a const variable and a mutable
variable set to the same value have different addresses.

Diffstat:
Mlib/std/meta.zig | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/std/meta.zig b/lib/std/meta.zig @@ -574,7 +574,7 @@ test "std.meta.eql" { .c = "54321".*, }; - const s_3 = S{ + var s_3 = S{ .a = 134, .b = 123.3, .c = "12345".*,