mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 08:04:50 +01:00
backend=auto (now the default if backend is omitted) means to let the compiler pick whatever backend it wants as the default. This is important for platforms where we don't yet have a self-hosted backend, such as loongarch64. Also purge a bunch of redundant target=native.
28 lines
539 B
Zig
28 lines
539 B
Zig
const std = @import(
|
|
"std",
|
|
);
|
|
const Allocator = std.mem.Allocator;
|
|
const ArrayList = std.ArrayList;
|
|
|
|
const HeaderWeight = enum { H1, H2, H3, H4, H5, H6 };
|
|
|
|
const MdText = ArrayList(u8);
|
|
|
|
const MdNode = union(enum) {
|
|
Header: struct {
|
|
text: MdText,
|
|
weight: HeaderValue,
|
|
},
|
|
};
|
|
|
|
export fn entry() void {
|
|
const a = MdNode.Header{
|
|
.text = MdText.init(std.testing.allocator),
|
|
.weight = HeaderWeight.H1,
|
|
};
|
|
_ = a;
|
|
}
|
|
|
|
// error
|
|
//
|
|
// :14:17: error: use of undeclared identifier 'HeaderValue'
|