Skip to content

Unsolved import when using the derivative crate #11581

Closed
@ChrisGreenaway

Description

@ChrisGreenaway

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions