Skip to content

Redundant Import Warning on Diesel Items #5154

Closed
@rschristian

Description

@rschristian

I'm currently running Clippy against a project I've made using Rocket and Diesel, and I'm getting redundant import warnings, specifically against items from Diesel.

warning: this import is redundant
  --> src/db/auth_repository.rs:10:10
   |
10 | #[derive(Insertable)]
   |          ^^^^^^^^^^
   |
   = note: `#[warn(clippy::single_component_path_imports)]` on by default
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports

warning: this import is redundant
 --> src/models/user.rs:7:10
  |
7 | #[derive(Queryable, Serialize)]
  |          ^^^^^^^^^
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports

warning: this import is redundant
 --> src/schema.rs:1:1
  |
1 | / table! {
2 | |     users (id) {
3 | |         id -> Int4,
4 | |         first_name -> Text,
... |
8 | |     }
9 | | }
  | |_^
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports
  = note: this warning originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

I could somehow be misunderstanding, but I'm not sure how a derived attribute could be a redundant import, nor how the schema could be. I stepped away from working on this project for a few months, so I'm not sure when this started, as I only updated all of my tools today.

As requested, Clippy version: clippy 0.0.212 (ea85b4c 2020-02-01)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingT-macrosType: Issues with macros and macro expansiongood first issueThese issues are a good way to get started with Clippy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions