Skip to content

Suggest macro import #75191

Description

@pickfire

I tried this code:

#[derive(Debug, Component, Clone, Copy)]
#[storage(VecStorage)]
pub struct Position {
    x: u8,
    y: u8,
    z: u8,
}

I expected to see this happen: compiler should suggest importing Component from specs (it is in Cargo.toml).

Instead, this happened: compiler say cannot find macro 'Component' but did not suggest importing it like other functions

error: cannot find derive macro `Component` in this scope
  --> src/main.rs:34:10
   |
34 | #[derive(Component)]
   |          ^^^^^^^^^

Meta

rustc --version --verbose:

rustc 1.47.0-nightly (d8cbd9cac 2020-08-03)
binary: rustc
commit-hash: d8cbd9caca648ecdb66ff4c945c060762aa6297f
commit-date: 2020-08-03
host: x86_64-unknown-linux-gnu
release: 1.47.0-nightly
LLVM version: 10.0

Also not available in stable.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-proc-macrosArea: Procedural macrosA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`C-enhancementCategory: An issue proposing an enhancement or a PR with one.D-papercutDiagnostics: An error or lint that needs small tweaks.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions