mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00: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.
21 lines
477 B
Zig
21 lines
477 B
Zig
export fn foo() void {
|
|
const x, const y = .{ 1, 2, 3 };
|
|
_ = .{ x, y };
|
|
}
|
|
|
|
export fn bar() void {
|
|
var x: u32 = undefined;
|
|
x, const y: u64 = blk: {
|
|
if (true) break :blk .{ 1, 2 };
|
|
break :blk .{ .x = 123, .y = 456 };
|
|
};
|
|
_ = y;
|
|
}
|
|
|
|
// error
|
|
//
|
|
// :2:25: error: expected 2 elements for destructure, found 3
|
|
// :2:22: note: result destructured here
|
|
// :10:21: error: struct value cannot be destructured
|
|
// :8:21: note: result destructured here
|