mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 00:34:06 +00:00
Use DUMMY_SP in multiple_crate_versions
This commit is contained in:
parent
663f2cff7e
commit
0d577c36a9
@ -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),
|
||||
);
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user