Skip to content

Internal Error related to "explanation" #543

@TheIronBorn

Description

@TheIronBorn

When running cargo check on an empty main.rs file I get this:

Rust Enhanced Internal Error: Traceback (most recent call last):
  File "C:\Users\<user>\AppData\Roaming\Sublime Text\Installed Packages\Rust Enhanced.sublime-package\rust/rust_proc.py", line 307, in _read_stdout
    self.listener.on_json(self, result)
  File "C:\Users\<user>\AppData\Roaming\Sublime Text\Installed Packages\Rust Enhanced.sublime-package\rust/opanel.py", line 123, in on_json
    None, self.msg_cb)
  File "C:\Users\<user>\AppData\Roaming\Sublime Text\Installed Packages\Rust Enhanced.sublime-package\rust/messages.py", line 821, in add_rust_messages
    primary_message)
  File "C:\Users\<user>\AppData\Roaming\Sublime Text\Installed Packages\Rust Enhanced.sublime-package\rust/messages.py", line 1086, in _collect_rust_messages
    set_primary_message(span, info['message'])
  File "C:\Users\<user>\AppData\Roaming\Sublime Text\Installed Packages\Rust Enhanced.sublime-package\rust/messages.py", line 942, in set_primary_message
    if info['code'] and info['code']['explanation']:
KeyError: 'explanation'

error: could not compile `testtest` (bin "testtest") due to 1 previous error
[Finished in 0.9s with exit code 101]

And the corresponding cargo check --message-format json output is:

    Checking testtest v0.1.0 (C:\<path>\testtest)
{"reason":"compiler-message","package_id":"path+file:///<path>/testtest#0.1.0","manifest_path":"C:\\<path>\\testtest\\Cargo.toml","target":{"kind":["bin"],"crate_types":["bin"],"name":"testtest","src_path":"C:\\<path>\\testtest\\src\\main.rs","edition":"2024","doc":true,"doctest":false,"test":true},"message":{"rendered":"error[E0601]: `main` function not found in crate `testtest`\n  |\n  = note: consider adding a `main` function to `src\\main.rs`\n\n","$message_type":"diagnostic","children":[{"children":[],"code":null,"level":"note","message":"consider adding a `main` function to `src\\main.rs`","rendered":null,"spans":[]}],"level":"error","message":"`main` function not found in crate `testtest`","spans":[{"byte_end":0,"byte_start":0,"column_end":1,"column_start":1,"expansion":null,"file_name":"src\\main.rs","is_primary":true,"label":null,"line_end":0,"line_start":0,"suggested_replacement":null,"suggestion_applicability":null,"text":[]}],"code":{"code":"E0601"}}}
{"reason":"compiler-message","package_id":"path+file:///<path>/testtest#0.1.0","manifest_path":"C:\\<path>\\testtest\\Cargo.toml","target":{"kind":["bin"],"crate_types":["bin"],"name":"testtest","src_path":"C:\\<path>\\testtest\\src\\main.rs","edition":"2024","doc":true,"doctest":false,"test":true},"message":{"rendered":"For more information about this error, try `rustc --explain E0601`.\n","$message_type":"diagnostic","children":[],"level":"failure-note","message":"For more information about this error, try `rustc --explain E0601`.","spans":[],"code":null}}
error: could not compile `testtest` (bin "testtest") due to 1 previous error
{"reason":"build-finished","success":false}

The error started on rust version:

rustc 1.92.0-nightly (595b9a498 2025-10-03)
binary: rustc
commit-hash: 595b9a498bc55fcd30111e430d8e4290ed833b4c
commit-date: 2025-10-03
host: x86_64-pc-windows-msvc
release: 1.92.0-nightly
LLVM version: 21.1.2

Metadata

Metadata

Assignees

No one assigned

    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