Zig Version
aas0.12.0-dev.2814+7775e46e8
Steps to Reproduce and Observed Output
const std = @import("std");
pub fn main() !void {
var x: u32 = 300;
_ = &x;
var y: u8 = @intCast(x);
_ = &y;
}
thread 174582 panic: integer cast truncated bits
/run/media/meghan/dev/test2.zig:6:17: 0x1033306 in main (test2)
var y: u8 = @intCast(x);
^
/home/meghan/src/zig/lib/std/start.zig:511:37: 0x1033290 in posixCallMainAndExit (test2)
const result = root.main() catch |err| {
^
/home/meghan/src/zig/lib/std/start.zig:253:5: 0x1032e01 in _start (test2)
asm volatile (switch (native_arch) {
^
???:?:?: 0x0 in ??? (???)
Aborted (core dumped)
Expected Output
panic: casting integer '300' into type 'u8' truncates bits
Zig Version
aas0.12.0-dev.2814+7775e46e8
Steps to Reproduce and Observed Output
Expected Output