std.StaticStringMap infered type breaking change

Hmm looking at this

It seems like the easier option is to just leave StaticStringMap the way it is and use an explicit array type, so @nm-remarkable’s example would become:

const presetMap = std.StaticStringMap(std.Target.Query).initComptime([_]struct{[]const u8, std.Target.Query}{
    .{ "arm-linux", .{ .cpu_arch = .aarch64, .os_tag = .linux } },
    .{ "native", .{} },
    .{ "linux", .{ .cpu_arch = .x86_64, .os_tag = .linux } }, // to be used for wsl on windows
});
2 Likes