Open jguhlin opened 1 year ago
I had the same problem
Still happening
I don't think that's spam.
I met such problem using VSCode and rust-analyzer from the extensions of VSC marketplace.
file with cargo diagnostic not found in vfs: file not found: /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/alloc/src/string.rs
I solved it by following the instructions in the quickstart of rust-analyzer (v0.3.1566)
and installed rustup 1.26.0-3 using pacman by $ pacman -S rustup
(rustup and rust were in conflict in pacman so I removed rust 1.70.1)
then $ rustup default update
installing stable-x86_64-unknown-linux-gnu installed - rustc 1.70.0 (90c541806 2023-05-31)
then I reinstalled the rust-analyzer extension and reload the rust-analyzer. It works well in my environment
Hope that can help you.
It seems that this is related to how for some macros r-a cannot pinpoint the exact file, from which they are called. I will look into this once again in the near future. For future reference here is an instance where I encountered this error.
version : 94afbe33c 2023-09-09
rustc -v : rustc 1.72.0 (5680fa18f 2023-08-23)
What happened? Flycheck didn't work because of the said error.
What caused it?
Enabling clippy with
"rust-analyzer.check.extraArgs" : [ "--" , "-D" , "warnings" ]
I added an additional log to further investigate the causes
Additional line :
tracing::debug!("AddDiagnostic {} {:#?} {:#?}" , id , workspace_root , diagnostic );
Where it was added :
Related logs:
ERROR rust_analyzer::main_loop] flycheck 0: File with cargo diagnostic not found in VFS: file not found: /path/to/ra/rust-analyzer/src/lib.rs
[DEBUG rust_analyzer::main_loop] AddDiagnostic 0 AbsPathBuf(
"/path/to/ra/rust-analyzer",
) Diagnostic {
message: "approximate value of `f{32, 64}::consts::PI` found",
code: Some(
DiagnosticCode {
code: "clippy::approx_constant",
explanation: None,
},
),
level: Error,
spans: [
DiagnosticSpan {
file_name: "src/lib.rs",
byte_start: 1170,
byte_end: 1174,
line_start: 36,
line_end: 36,
column_start: 49,
column_end: 53,
is_primary: true,
text: [
DiagnosticSpanLine {
text: " TokenTree::from(Literal::f64_unsuffixed(3.14)),",
highlight_start: 49,
highlight_end: 53,
},
],
label: None,
suggested_replacement: None,
suggestion_applicability: None,
expansion: None,
},
],
children: [
Diagnostic {
message: "consider using the constant directly",
code: None,
level: Help,
spans: [],
children: [],
rendered: None,
},
Diagnostic {
message: "for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#approx_constant",
code: None,
level: Help,
spans: [],
children: [],
rendered: None,
},
],
rendered: Some(
"error: approximate value of `f{32, 64}::consts::PI` found\n --> src/lib.rs:36:49\n |\n36 | TokenTree::from(Literal::f64_unsuffixed(3.14)),\n | ^^^^\n |\n = help: consider using the constant directly\n = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#approx_constant\n\n",
),
}
@rustbot claim
I met such problem using VSCode and rust-analyzer from the extensions of VSC marketplace.
file with cargo diagnostic not found in vfs: file not found: /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/alloc/src/string.rs
I solved it by following the instructions in the
quickstart of rust-analyzer (v0.3.1566)
and installed rustup 1.26.0-3 using pacman by$ pacman -S rustup
(rustup and rust were in conflict in pacman so I removed rust 1.70.1)then
$ rustup default update
installingstable-x86_64-unknown-linux-gnu installed - rustc 1.70.0 (90c541806 2023-05-31)
then I reinstalled the rust-analyzer extension and reload the rust-analyzer. It works well in my environment
Hope that can help you.
that does work. Tks~(though,currently the command seems to be
rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P)
rust-analyzer version: 0.3.1258-standalone (43fb9563b 2022-10-23)
rustc version: (eg. output of
rustc -V
)rustc 1.66.0-nightly (9565dfeb4 2022-10-28)
I am getting errors like these:
These are very weird, as those files should not exist (sfa and libsfasta are folders in a different project, and are not and should not be present in the phyloclap project).
It is referenced as such in Cargo.toml though:
libsfasta = { path = "../sfasta/libsfasta" }
So maybe I am misunderstanding something? I have been trying to debug why I do not get compilation errors in VSCode anymore inline as red, but everything else re: Rust-analyzer is working, and this is the only type of error showing up.