Example nested xtask crate structure results in unlinked-file rust-analyzer error
nickgerace opened this issue · 0 comments
Description
Hi! I'm unsure if this is a rust-analyzer or cargo-xtask issue, but I receive the following rust-analyzer message for my repository layout in the xtask's main.rs
file:
file not included in module tree rust-analyzer
(unlinked-file)
My repository layout reflects the hello-world example. I can display more files if needed, but these are the ones I believe to be relevant:
Cargo.toml <-- standard single-crate-per-repo Cargo.toml file structure
.cargo/
config <-- contains xtask alias
src/
main.rs
xtask/
src/
main.rs <-- error occurs here
Findings
I am curiuous if the xtask pattern requires the use of cargo workspaces. The example in this repository does not use cargo workspaces, so I am curious if I am missing something, or if the example in the repository should change.
The good news is that the xtask does work. Perhaps, rust-analyzer is the issue and I should file an issue there. At this point, I am unsure, but thought I would start here since I see xtask used in workspaces more often than as a nested crate.
Thanks in advance for any and all help here.
Environment
- rust-analyzer
0.2.654
(VS Code extension) - macOS 11.4 amd64
- VS Code
1.57.1
- cargo
1.53.0
(4369396ce 2021-04-27
) - rustc
1.53.0
(53cb7b09b 2021-06-17
)