Open LorDawid opened 1 week ago
I think your code has a bug: it needs to be library.get::<fn(u64, u64)>(name.as_bytes())
(unrelated though, this is still a rust-analyzer bug).
@ChayimFriedman2 the variable i get from the library is a mut static: fn(u64, u64)
initialized to a panicking function by default, so AFAIK this is correct
rust-analyzer version: rust-analyzer version: 0.3.2137-standalone [/home/dawid/.vscode/extensions/rust-lang.rust-analyzer-0.3.2137-linux-x64/server/rust-analyzer]
rustc version: rustc 1.82.0 (f6e511eec 2024-10-15)
editor or extension: VSCode
relevant settings: None
code snippet to reproduce:
Rust-analyzer produces a false-positive
cannot mutate immutable variable `sym` rust-analyzer(E0384)
- the compiler does not report any issues. Marking that variable as mutable produces a warningvariable does not need to be mutable
.As shown in the commented sample, manually dereferencing the variable set-by-step works.
UPDATE: This is a simplier example.