mirror of
https://github.com/ziglang/zig.git
synced 2025-12-09 07:43:10 +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.
17 lines
480 B
Zig
17 lines
480 B
Zig
export fn entry1() void {
|
|
const y: [:1]const u8 = &[_:2]u8{ 1, 2 };
|
|
_ = y;
|
|
}
|
|
export fn entry2() void {
|
|
const x: [:2]const u8 = &.{ 1, 2 };
|
|
const y: [:1]const u8 = x;
|
|
_ = y;
|
|
}
|
|
|
|
// error
|
|
//
|
|
// :2:37: error: expected type '[2:1]u8', found '[2:2]u8'
|
|
// :2:37: note: array sentinel '2' cannot cast into array sentinel '1'
|
|
// :7:29: error: expected type '[:1]const u8', found '[:2]const u8'
|
|
// :7:29: note: pointer sentinel '2' cannot cast into pointer sentinel '1'
|