Skip to content

Fix test/spec.zig compile error due to StringArrayHashMap - #130

Open
wingyplus wants to merge 1 commit into
kubkon:mainfrom
wingyplus:fix-zig-0-16
Open

Fix test/spec.zig compile error due to StringArrayHashMap#130
wingyplus wants to merge 1 commit into
kubkon:mainfrom
wingyplus:fix-zig-0-16

Conversation

@wingyplus

Copy link
Copy Markdown

Found on zig 0.16:

$ zig version
0.16.0
$ zig build test
test/spec.zig:100:24: error: root source file struct 'std' has no member named 'StringArrayHashMap'
    var testcases = std.StringArrayHashMap(Testcase).init(arena);
                    ~~~^~~~~~~~~~~~~~~~~~~
/Users/thanabodee/compilers/zig/lib/std/std.zig:1:1: note: struct declared here
pub const AutoHashMap = hash_map.AutoHashMap;
^~~
referenced by:
    create: test/spec.zig:59:92
    build: build.zig:61:36
    6 reference(s) hidden; use '-freference-trace=8' to see all references

So this changes convert it to std.array_has_map.String and fix compile error after changing.

Tested by run zig build test and has no issue.

Found on zig 0.16:

```
$ zig version
0.16.0
$ zig build test
test/spec.zig:100:24: error: root source file struct 'std' has no member named 'StringArrayHashMap'
    var testcases = std.StringArrayHashMap(Testcase).init(arena);
                    ~~~^~~~~~~~~~~~~~~~~~~
/Users/thanabodee/compilers/zig/lib/std/std.zig:1:1: note: struct declared here
pub const AutoHashMap = hash_map.AutoHashMap;
^~~
referenced by:
    create: test/spec.zig:59:92
    build: build.zig:61:36
    6 reference(s) hidden; use '-freference-trace=8' to see all references
```

So this changes convert it to `std.array_has_map.String` and fix
compile error after changing.

Tested by run `zig build test` and has no issue.

Signed-off-by: Thanabodee Charoenpiriyakij <wingyminus@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant