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
458 B
Zig
21 lines
458 B
Zig
export fn a() void {
|
|
var box = Box{ .field = 0 };
|
|
_ = &box;
|
|
box.*.field = 1;
|
|
}
|
|
export fn b() void {
|
|
var box = Box{ .field = 0 };
|
|
const box_ptr = &box;
|
|
box_ptr.*.*.field = 1;
|
|
}
|
|
pub const Box = struct {
|
|
field: i32,
|
|
};
|
|
|
|
// error
|
|
//
|
|
// :4:8: error: cannot dereference non-pointer type 'tmp.Box'
|
|
// :11:17: note: struct declared here
|
|
// :9:14: error: cannot dereference non-pointer type 'tmp.Box'
|
|
// :11:17: note: struct declared here
|