Can I improve the compile-time panic messages to be more helpful? I've tried setting RUST_BACKTRACE
, but it doesn't seem to work.
[nix-shell:~/code/advent-of-code-2021]$ ./roc/target/release/roc build test.roc
thread 'main' panicked at 'Found StructValue(StructValue { struct_value: Value { name: "load_result", address: 0x600002c77980, is_const: false, is_null: false, is_undef: false, llvm_value: " %load_result = load { { [3 x i64] }, i64 }, { { [3 x i64] }, i64 }* %result_value, align 8, !dbg !463", llvm_type: "{ { [3 x i64] }, i64 }" } }) but expected PointerValue variant', /Users/jan/.cargo/git/checkouts/inkwell-85610d8ccb0c28f9/e15d665/src/values/enums.rs:285:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
🔨 Rebuilding host...
[nix-shell:~/code/advent-of-code-2021]$ RUST_BACKTRACE=1
[nix-shell:~/code/advent-of-code-2021]$ ./roc/target/release/roc build test.roc
thread 'main' panicked at 'Found StructValue(StructValue { struct_value: Value { name: "load_result", address: 0x600003841640, is_const: false, is_null: false, is_undef: false, llvm_value: " %load_result = load { { [3 x i64] }, i64 }, { { [3 x i64] }, i64 }* %result_value, align 8, !dbg !463", llvm_type: "{ { [3 x i64] }, i64 }" } }) but expected PointerValue variant', /Users/jan/.cargo/git/checkouts/inkwell-85610d8ccb0c28f9/e15d665/src/values/enums.rs:285:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
🔨 Rebuilding host...
[nix-shell:~/code/advent-of-code-2021]$
oh I'd like to see the code for this
is that the syntax for env variables in nix? it should show a backtrace
It's possible that you need to include RUST_BACKTRACE=1
in the nix.shell file under # Additional Env vars
.
Then type exit
in the nix shell and run nix-shell
again.
@JanCVanB I think you need export RUST_BACKTRACE=1
:face_palm: You're all right, bad env var. export RUST_BACKTRACE=1
works as intended.
You should also just be able to put everything on the same line. That is what I normally do:
RUST_BACKTRACE=1 ./roc rest of command
Can you make an issue with the roc code included for the panic @JanCVanB ?
Folkert de Vries said:
oh I'd like to see the code for this
This was trying to test File I/O via the example/cli/platform
on the cli-file-io
branch, but it seems to still be a work in progress.
Given that context (and that I half-expected it to fail), do y'all still want me to submit an issue? @Anton
@Folkert de Vries ?
Yes please
Last updated: Jul 06 2025 at 12:14 UTC