Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example nested xtask crate structure results in unlinked-file rust-analyzer error #16

Open
nickgerace opened this issue Jul 2, 2021 · 0 comments

Comments

@nickgerace
Copy link

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 Code1.57.1
  • cargo 1.53.0 (4369396ce 2021-04-27)
  • rustc 1.53.0 (53cb7b09b 2021-06-17)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant