Skip to content

Unsolved import when using the derivative crate #11581

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

Closed
ChrisGreenaway opened this issue Feb 28, 2022 · 2 comments
Closed

Unsolved import when using the derivative crate #11581

ChrisGreenaway opened this issue Feb 28, 2022 · 2 comments

Comments

@ChrisGreenaway
Copy link

rust-analyzer version: (eg. output of "Rust Analyzer: Show RA Version" command)
v0.2.956

rustc version: (eg. output of rustc -V)
rustc 1.59.0 (9d1b2106e 2022-02-23)

relevant settings: (eg. client settings, or environment variables like CARGO, RUSTUP_HOME or CARGO_HOME)
Using VS Code

The following project causes an "unresolved import" on the first line of main.rs:

Cargo.toml
==========
[package]
name = "scratch"
version = "0.1.0"
edition = "2021"

[dependencies]
derivative = "2.2.0"


main.rs
=======
use derivative::Derivative;

#[derive(Derivative)]
#[derivative(Debug)]
struct Test;

fn main() {
    let value = Test;
    println!("{value:?}");
}

It compiles and runs fine.

@lnicola
Copy link
Member

lnicola commented Feb 28, 2022

Duplicate of #7459. You can try setting rust-analyzer.cargo.unsetTest.

@ChrisGreenaway
Copy link
Author

Setting unsetTest, as recommended in #7459, solved this. Thanks.

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

2 participants