Scalar size mismatch: expected 2350837905160 bytes but got 8 bytes instead

I've this recurring error popping up and I've no idea how to fix it. I repaired visual studio community installation, removed and reinstalled rustup, switched toolchains and targets (msvc to gnu and back) ... no luck.

The error pops up with different values both when building and in vscode when saving files (as it triggers rust-analyzer parsing). When writing code I just save again and it goes away, but when it comes to build complex projects there's no way for them to run from beginning to the end. And in any case... it's silly to keep it like this.

Any idea?

?? Are you sure weren't expecting a value of 2350837905160? That is a very large number of bytes. 8 bytes (63 bits if signed) can hold a value of 9223372036854775807.

To work with that many bytes you'll have to work in a string, not a numeric type.

Ain't a code issue. It's something terribly wrong in the toolchain or the underlying OS (btw: windows11, visual studio community 2022) or even the hardware (intel 14900K, but it isn't a flawed cpu; I repeated the burn-in test yesterday, then checked the ram).

Problem is I don't know how to troubleshoot it.

????
Even as ASCII characters of decimal 2350837905160 it is a 13 byte string.
You're including some relevant info.

Dude, you are trying to interpret the numerical value of ... go figure what corruption result ... the number you are pointing at isn't important! Probably it's a random number because of some nasty compiler corruption!

Not without more details, nope. Where are you seeing this error? What's the line/column/context? In any way similar to this? Including the error[E0080]: evaluation of constant value failed?

This is attempting to compile a patched version of probe-rs from a developer addressing an rp2040 issue (ie: building x86 exe):

repo-pico-rust\test> cargo install probe-rs-tools --git https://github.com/xobs/probe-rs.git --branch add-rp2040-reset --force
    Updating git repository `https://github.com/xobs/probe-rs.git`
  Installing probe-rs-tools v0.29.0 (https://github.com/xobs/probe-rs.git?branch=add-rp2040-reset#0a2ac26d)
    Blocking waiting for file lock on package cache
    Updating crates.io index
    Blocking waiting for file lock on package cache
     Locking 458 packages to latest compatible versions
      Adding cobs v0.3.0 (available: v0.4.0)
      Adding unicode-width v0.2.0 (available: v0.2.1)
    Blocking waiting for file lock on package cache
   Compiling proc-macro2 v1.0.95

[...]

   Compiling capstone v0.13.0
error[E0080]: evaluation of constant value failed
   --> probe-rs-tools\src\bin\probe-rs\rpc\functions.rs:456:1
    |
456 | / endpoints! {
457 | |     list = ENDPOINT_LIST;
458 | |     | EndpointTy                | RequestTy              | ResponseTy              | Path               |
459 | |     | ----------                | ---------              | ----------              | ----               |
...   |
494 | |     | WriteMemory64Endpoint     | WriteMemory64Request   | NoResponse              | "memory/write64"   |
495 | | }
    | |_^ scalar size mismatch: expected 0 bytes but got 8 bytes instead
    |
note: inside `merge_nty_lists::<221>`
   --> .cargo\registry\src\index.crates.io-1949cf8c6b5b557f\postcard-rpc-0.11.9\src\uniques.rs:703:35

[...]

I can't reproduce the same error for an rp2040 bin as well as I'm in the middle of re-installing but ... the target doesn't matter... it pops out for an x86 and an arm target, in terminal as well as in vscode's rust-analyzer output... and it goes away retrying without changing anything in code. It's a toolchain issue.

The numerical values in the error are not important, they change every time.

Is this nightly or stable? Which version, exactly?

Have you tried on a different PC?

Have you run diagnostics on your RAM? https://memtest.org/ has a reasonable memory tester.