diff --git a/clippy_lints/src/multiple_crate_versions.rs b/clippy_lints/src/multiple_crate_versions.rs index dbf8cbe16c2..9507522ed10 100644 --- a/clippy_lints/src/multiple_crate_versions.rs +++ b/clippy_lints/src/multiple_crate_versions.rs @@ -7,12 +7,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - //! lint on multiple versions of a crate being used use crate::rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass}; use crate::rustc::{declare_tool_lint, lint_array}; -use crate::syntax::ast::*; +use crate::syntax::{ast::*, source_map::DUMMY_SP}; use crate::utils::span_lint; use cargo_metadata; @@ -54,12 +53,7 @@ impl EarlyLintPass for Pass { let metadata = if let Ok(metadata) = cargo_metadata::metadata_deps(None, true) { metadata } else { - span_lint( - cx, - MULTIPLE_CRATE_VERSIONS, - krate.span, - "could not read cargo metadata" - ); + span_lint(cx, MULTIPLE_CRATE_VERSIONS, krate.span, "could not read cargo metadata"); return; }; @@ -76,7 +70,7 @@ impl EarlyLintPass for Pass { span_lint( cx, MULTIPLE_CRATE_VERSIONS, - krate.span, + DUMMY_SP, &format!("multiple versions for dependency `{}`: {}", name, versions), ); } diff --git a/clippy_lints/src/wildcard_dependencies.rs b/clippy_lints/src/wildcard_dependencies.rs index 00533efb8e5..8f2f1aeb27a 100644 --- a/clippy_lints/src/wildcard_dependencies.rs +++ b/clippy_lints/src/wildcard_dependencies.rs @@ -9,8 +9,7 @@ use crate::rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass}; use crate::rustc::{declare_tool_lint, lint_array}; -use crate::syntax::ast::*; -use crate::syntax::source_map::DUMMY_SP; +use crate::syntax::{ast::*, source_map::DUMMY_SP}; use crate::utils::span_lint; use cargo_metadata;