Closed mrk-its closed 1 year ago
following program
#![no_std] #![feature(start)] #![allow(unused_variables)] use core::panic::PanicInfo; use ufmt_stdio::*; #[panic_handler] fn panic(info: &PanicInfo) -> ! { println!("PANIC"); loop {} } #[start] fn main(_argc: isize, _argv: *const *const u8) -> isize { let mut result: u128 = 1; for i in 0..3 { result = result.rotate_left(1) + 1; println!("result: {:x}", result as u8); } 0 }
crashes compiler with:
error: could not compile `hang` Caused by: process didn't exit successfully: `rustc --crate-name hang --edition=2021 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C opt-level=s -C panic=abort -C lto -C debuginfo=0 -C debug-assertions=on -C metadata=bedb8a7130cdad6f -C extra-filename=-bedb8a7130cdad6f --out-dir /home/mrk/repos/aoc2021/hang/target/mos-sim-none/debug/deps --target mos-sim-none -C incremental=/home/mrk/repos/aoc2021/hang/target/mos-sim-none/debug/incremental -L dependency=/home/mrk/repos/aoc2021/hang/target/mos-sim-none/debug/deps -L dependency=/home/mrk/repos/aoc2021/hang/target/debug/deps --extern 'noprelude:alloc=/home/mrk/repos/aoc2021/hang/target/mos-sim-none/debug/deps/liballoc-d1ba5bbca22f24c1.rlib' --extern 'noprelude:compiler_builtins=/home/mrk/repos/aoc2021/hang/target/mos-sim-none/debug/deps/libcompiler_builtins-9aa5ae9daf052682.rlib' --extern 'noprelude:core=/home/mrk/repos/aoc2021/hang/target/mos-sim-none/debug/deps/libcore-cb8a1305de83f86f.rlib' --extern ufmt_stdio=/home/mrk/repos/aoc2021/hang/target/mos-sim-none/debug/deps/libufmt_stdio-85387fe3163ee1a0.rlib -Z unstable-options` (signal: 11, SIGSEGV: invalid memory reference)
following program
crashes compiler with: