Skip to content

Compiler panic in to_bytecode/translate.rs: divergent expression inside vector literal #25750

@jubnzv

Description

@jubnzv

The compiler panics with an ICE in to_bytecode/translate.rs:972 when a vector literal contains a divergent expression (e.g. abort) and the result is bound to a variable.

The issue is that the typing pass accepts vector[{ abort 0 }] (abort is valid in any expression position and the vector element type becomes uninferred), but the bytecode translation assumes all types are concrete at that point.

MRE:

module 0x2a::M {
    fun f(): u64 {
        let v = vector[{ abort 0 }];
        0
    }
}

Reproduce steps:

cd external-crates/move
cargo +nightly run --release -p move-compiler --bin move-check -- mre.move

Output:

thread 'main' panicked at crates/move-compiler/src/to_bytecode/translate.rs:972:13:
ICE should not have reached compilation if there are errors
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Expected behavior: a warning about unreachable code or dead variable, not an ICE.

Git commit: a52ef37
Build: release
cargo 1.91.0-nightly (840b83a10 2025-07-30)
rustc 1.91.0-nightly (3672a55b7 2025-08-13)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions