Skip to content

Commit

Permalink
codemap -> source_map
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Aug 20, 2018
1 parent 07c2e61 commit 76321d3
Show file tree
Hide file tree
Showing 52 changed files with 61 additions and 61 deletions.
2 changes: 1 addition & 1 deletion clippy_lints/src/arithmetic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::utils::span_lint;
use rustc::hir;
use rustc::lint::*;
use rustc::{declare_lint, lint_array};
use syntax::codemap::Span;
use syntax::source_map::Span;

/// **What it does:** Checks for plain integer arithmetic.
///
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use if_chain::if_chain;
use rustc::ty::{self, TyCtxt};
use semver::Version;
use syntax::ast::{AttrStyle, Attribute, Lit, LitKind, MetaItemKind, NestedMetaItem, NestedMetaItemKind};
use syntax::codemap::Span;
use syntax::source_map::Span;

/// **What it does:** Checks for items annotated with `#[inline(always)]`,
/// unless the annotated function is empty or simply panics.
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/bit_mask.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use rustc::lint::*;
use rustc::{declare_lint, lint_array};
use if_chain::if_chain;
use syntax::ast::LitKind;
use syntax::codemap::Span;
use syntax::source_map::Span;
use crate::utils::{span_lint, span_lint_and_then};
use crate::utils::sugg::Sugg;
use crate::consts::{constant, Constant};
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/booleans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use rustc::{declare_lint, lint_array};
use rustc::hir::*;
use rustc::hir::intravisit::*;
use syntax::ast::{LitKind, NodeId, DUMMY_NODE_ID};
use syntax::codemap::{dummy_spanned, Span, DUMMY_SP};
use syntax::source_map::{dummy_spanned, Span, DUMMY_SP};
use rustc_data_structures::thin_vec::ThinVec;
use crate::utils::{in_macro, paths, match_type, snippet_opt, span_lint_and_then, SpanlessEq, get_trait_def_id, implements_trait};

Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/cyclomatic_complexity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use rustc::hir::*;
use rustc::ty;
use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
use syntax::ast::{Attribute, NodeId};
use syntax::codemap::Span;
use syntax::source_map::Span;

use crate::utils::{in_macro, is_allowed, match_type, paths, span_help_and_lint, LimitStack};

Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use rustc::{declare_lint, lint_array};
use if_chain::if_chain;
use rustc::ty::{self, Ty};
use rustc::hir::*;
use syntax::codemap::Span;
use syntax::source_map::Span;
use crate::utils::paths;
use crate::utils::{is_automatically_derived, is_copy, match_path, span_lint_and_then};

Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use pulldown_cmark;
use rustc::lint::*;
use rustc::{declare_lint, lint_array};
use syntax::ast;
use syntax::codemap::{BytePos, Span};
use syntax::source_map::{BytePos, Span};
use syntax_pos::Pos;
use crate::utils::span_lint;
use url::Url;
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/double_comparison.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use rustc::hir::*;
use rustc::lint::*;
use rustc::{declare_lint, lint_array};
use syntax::codemap::Span;
use syntax::source_map::Span;

use crate::utils::{snippet, span_lint_and_sugg, SpanlessEq};

Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/duration_subsec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use rustc::hir::*;
use rustc::lint::*;
use rustc::{declare_lint, lint_array};
use if_chain::if_chain;
use syntax::codemap::Spanned;
use syntax::source_map::Spanned;

use crate::consts::{constant, Constant};
use crate::utils::paths;
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
use rustc::lint::*;
use rustc::{declare_lint, lint_array};
use if_chain::if_chain;
use syntax::codemap::Span;
use syntax::source_map::Span;
use crate::utils::SpanlessEq;
use crate::utils::{get_item_name, match_type, paths, snippet, span_lint_and_then, walk_ptrs_ty};

Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/enum_glob_use.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use rustc::hir::def::Def;
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
use rustc::{declare_lint, lint_array};
use syntax::ast::NodeId;
use syntax::codemap::Span;
use syntax::source_map::Span;
use crate::utils::span_lint;

/// **What it does:** Checks for `use Enum::*`.
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/enum_variants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use rustc::lint::*;
use rustc::{declare_lint, lint_array};
use syntax::ast::*;
use syntax::codemap::Span;
use syntax::source_map::Span;
use syntax::symbol::LocalInternedString;
use crate::utils::{span_help_and_lint, span_lint};
use crate::utils::{camel_case_from, camel_case_until, in_macro};
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/erasing_op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::consts::{constant_simple, Constant};
use rustc::hir::*;
use rustc::lint::*;
use rustc::{declare_lint, lint_array};
use syntax::codemap::Span;
use syntax::source_map::Span;
use crate::utils::{in_macro, span_lint};

/// **What it does:** Checks for erasing operations, e.g. `x * 0`.
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/escape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use rustc::ty::{self, Ty};
use rustc::ty::layout::LayoutOf;
use rustc::util::nodemap::NodeSet;
use syntax::ast::NodeId;
use syntax::codemap::Span;
use syntax::source_map::Span;
use crate::utils::span_lint;

pub struct Pass {
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use rustc::hir::def::Def;
use std::collections::HashSet;
use syntax::ast;
use rustc_target::spec::abi::Abi;
use syntax::codemap::Span;
use syntax::source_map::Span;
use crate::utils::{iter_input_pats, span_lint, type_is_unsafe_function};

/// **What it does:** Checks for functions with too many parameters.
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/identity_op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::consts::{constant_simple, Constant};
use rustc::hir::*;
use rustc::lint::*;
use rustc::{declare_lint, lint_array};
use syntax::codemap::Span;
use syntax::source_map::Span;
use crate::utils::{in_macro, snippet, span_lint, unsext, clip};
use rustc::ty;

Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/len_zero.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use rustc::{declare_lint, lint_array};
use rustc::ty;
use std::collections::HashSet;
use syntax::ast::{Lit, LitKind, Name};
use syntax::codemap::{Span, Spanned};
use syntax::source_map::{Span, Spanned};
use crate::utils::{get_item_name, in_macro, snippet, span_lint, span_lint_and_sugg, walk_ptrs_ty};

/// **What it does:** Checks for getting the length of something via `.len()`
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/lifetimes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use rustc::hir::def::Def;
use rustc::hir::*;
use rustc::hir::intravisit::*;
use std::collections::{HashMap, HashSet};
use syntax::codemap::Span;
use syntax::source_map::Span;
use crate::utils::{last_path_segment, span_lint};
use syntax::symbol::keywords;

Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/loops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use rustc::ty::subst::Subst;
use std::collections::{HashMap, HashSet};
use std::iter::{once, Iterator};
use syntax::ast;
use syntax::codemap::Span;
use syntax::source_map::Span;
use crate::utils::{sugg, sext};
use crate::utils::usage::mutated_variables;
use crate::consts::{constant, Constant};
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/map_unit_fn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use rustc::{declare_lint, lint_array};
use if_chain::if_chain;
use rustc::ty;
use rustc_errors::Applicability;
use syntax::codemap::Span;
use syntax::source_map::Span;
use crate::utils::{in_macro, iter_input_pats, match_type, method_chain_args, snippet, span_lint_and_then};
use crate::utils::paths;

Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/matches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use rustc::ty::{self, Ty};
use std::cmp::Ordering;
use std::collections::Bound;
use syntax::ast::LitKind;
use syntax::codemap::Span;
use syntax::source_map::Span;
use crate::utils::paths;
use crate::utils::{expr_block, is_allowed, is_expn_of, match_qpath, match_type, multispan_sugg,
remove_blocks, snippet, span_lint_and_sugg, span_lint_and_then, span_note_and_lint, walk_ptrs_ty};
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::borrow::Cow;
use std::fmt;
use std::iter;
use syntax::ast;
use syntax::codemap::{Span, BytePos};
use syntax::source_map::{Span, BytePos};
use crate::utils::{get_arg_name, get_trait_def_id, implements_trait, in_macro, is_copy, is_expn_of, is_self,
is_self_ty, iter_input_pats, last_path_segment, match_def_path, match_path, match_qpath, match_trait_method,
match_type, method_chain_args, match_var, return_ty, remove_blocks, same_tys, single_segment_path, snippet,
Expand Down Expand Up @@ -1311,7 +1311,7 @@ fn lint_unnecessary_fold(cx: &LateContext<'_, '_>, expr: &hir::Expr, fold_args:

then {
// Span containing `.fold(...)`
let next_point = cx.sess().codemap().next_point(fold_args[0].span);
let next_point = cx.sess().source_map().next_point(fold_args[0].span);
let fold_span = next_point.with_hi(fold_args[2].span.hi() + BytePos(1));

let sugg = if replacement_has_args {
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use rustc::lint::*;
use rustc::{declare_lint, lint_array};
use if_chain::if_chain;
use rustc::ty;
use syntax::codemap::{ExpnFormat, Span};
use syntax::source_map::{ExpnFormat, Span};
use crate::utils::{get_item_name, get_parent_expr, implements_trait, in_constant, in_macro, is_integer_literal,
iter_input_pats, last_path_segment, match_qpath, match_trait_method, paths, snippet, span_lint,
span_lint_and_then, walk_ptrs_ty, SpanlessEq};
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/misc_early.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use if_chain::if_chain;
use std::collections::HashMap;
use std::char;
use syntax::ast::*;
use syntax::codemap::Span;
use syntax::source_map::Span;
use syntax::visit::FnKind;
use crate::utils::{constants, snippet, snippet_opt, span_help_and_lint, span_lint, span_lint_and_then};

Expand Down Expand Up @@ -235,7 +235,7 @@ impl EarlyLintPass for MiscEarly {
for field in pfields {
match field.node.pat.node {
PatKind::Wild => {},
_ => if let Ok(n) = cx.sess().codemap().span_to_snippet(field.span) {
_ => if let Ok(n) = cx.sess().source_map().span_to_snippet(field.span) {
normal.push(n);
},
}
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/missing_doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use rustc::{declare_lint, lint_array};
use rustc::ty;
use syntax::ast;
use syntax::attr;
use syntax::codemap::Span;
use syntax::source_map::Span;
use crate::utils::in_macro;

/// **What it does:** Warns if there is missing doc for any documentable item
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/missing_inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use rustc::hir;
use rustc::lint::*;
use rustc::{declare_lint, lint_array};
use syntax::ast;
use syntax::codemap::Span;
use syntax::source_map::Span;

/// **What it does:** it lints if an exported function, method, trait method with default impl,
/// or trait method impl is not `#[inline]`.
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/needless_bool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use rustc::lint::*;
use rustc::{declare_lint, lint_array};
use rustc::hir::*;
use syntax::ast::LitKind;
use syntax::codemap::Spanned;
use syntax::source_map::Spanned;
use crate::utils::{snippet, span_lint, span_lint_and_sugg};
use crate::utils::sugg::Sugg;

Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/needless_continue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
use rustc::lint::*;
use rustc::{declare_lint, lint_array};
use syntax::ast;
use syntax::codemap::{original_sp, DUMMY_SP};
use syntax::source_map::{original_sp, DUMMY_SP};
use std::borrow::Cow;

use crate::utils::{in_macro, snippet, snippet_block, span_help_and_lint, trim_multiline};
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/neg_multiply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use rustc::hir::*;
use rustc::lint::*;
use rustc::{declare_lint, lint_array};
use if_chain::if_chain;
use syntax::codemap::{Span, Spanned};
use syntax::source_map::{Span, Spanned};

use crate::consts::{self, Constant};
use crate::utils::span_lint;
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/new_without_default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use rustc::lint::*;
use rustc::{declare_lint, lint_array};
use if_chain::if_chain;
use rustc::ty::{self, Ty};
use syntax::codemap::Span;
use syntax::source_map::Span;
use crate::utils::paths;
use crate::utils::{get_trait_def_id, implements_trait, return_ty, same_tys, span_lint_and_then};
use crate::utils::sugg::DiagnosticBuilderExt;
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/non_expressive_names.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use rustc::lint::*;
use rustc::{declare_lint, lint_array};
use syntax::codemap::Span;
use syntax::source_map::Span;
use syntax::symbol::LocalInternedString;
use syntax::ast::*;
use syntax::attr;
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/open_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use rustc::hir::{Expr, ExprKind};
use rustc::lint::*;
use rustc::{declare_lint, lint_array};
use syntax::ast::LitKind;
use syntax::codemap::{Span, Spanned};
use syntax::source_map::{Span, Spanned};
use crate::utils::{match_type, paths, span_lint, walk_ptrs_ty};

/// **What it does:** Checks for duplicate open options as well as combinations
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/precedence.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use rustc::lint::*;
use rustc::{declare_lint, lint_array};
use syntax::ast::*;
use syntax::codemap::Spanned;
use syntax::source_map::Spanned;
use crate::utils::{in_macro, snippet, span_lint_and_sugg};

/// **What it does:** Checks for operations where precedence may be unclear
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use rustc::{declare_lint, lint_array};
use if_chain::if_chain;
use rustc::ty;
use syntax::ast::NodeId;
use syntax::codemap::Span;
use syntax::source_map::Span;
use syntax_pos::MultiSpan;
use crate::utils::{match_qpath, match_type, paths, snippet_opt, span_lint, span_lint_and_then, walk_ptrs_hir_ty};
use crate::utils::ptr::get_spans;
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/ranges.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use rustc::{declare_lint, lint_array};
use if_chain::if_chain;
use rustc::hir::*;
use syntax::ast::RangeLimits;
use syntax::codemap::Spanned;
use syntax::source_map::Spanned;
use crate::utils::{is_integer_literal, paths, snippet, span_lint, span_lint_and_then};
use crate::utils::{get_trait_def_id, higher, implements_trait, SpanlessEq};
use crate::utils::sugg::Sugg;
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/regex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use rustc::{declare_lint, lint_array};
use if_chain::if_chain;
use std::collections::HashSet;
use syntax::ast::{LitKind, NodeId, StrStyle};
use syntax::codemap::{BytePos, Span};
use syntax::source_map::{BytePos, Span};
use crate::utils::{is_expn_of, match_def_path, match_type, opt_def_id, paths, span_help_and_lint, span_lint};
use crate::consts::{constant, Constant};

Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/returns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use rustc::lint::*;
use rustc::{declare_lint, lint_array};
use if_chain::if_chain;
use syntax::ast;
use syntax::codemap::Span;
use syntax::source_map::Span;
use syntax::visit::FnKind;

use crate::utils::{in_macro, match_path_ast, snippet_opt, span_lint_and_then, span_note_and_lint};
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/shadow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use rustc::{declare_lint, lint_array};
use rustc::hir::*;
use rustc::hir::intravisit::FnKind;
use rustc::ty;
use syntax::codemap::Span;
use syntax::source_map::Span;
use crate::utils::{contains_name, higher, iter_input_pats, snippet, span_lint_and_then};

/// **What it does:** Checks for bindings that shadow other bindings already in
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/strings.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use rustc::hir::*;
use rustc::lint::*;
use rustc::{declare_lint, lint_array};
use syntax::codemap::Spanned;
use syntax::source_map::Spanned;
use crate::utils::SpanlessEq;
use crate::utils::{get_parent_expr, is_allowed, match_type, paths, span_lint, span_lint_and_sugg, walk_ptrs_ty};

Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use std::cmp::Ordering;
use std::collections::BTreeMap;
use std::borrow::Cow;
use syntax::ast::{FloatTy, IntTy, UintTy};
use syntax::codemap::Span;
use syntax::source_map::Span;
use syntax::errors::DiagnosticBuilder;
use crate::utils::{comparisons, differing_macro_contexts, higher, in_constant, in_macro, last_path_segment, match_def_path, match_path,
match_type, multispan_sugg, opt_def_id, same_tys, snippet, snippet_opt, span_help_and_lint, span_lint,
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/unicode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use rustc::lint::*;
use rustc::{declare_lint, lint_array};
use rustc::hir::*;
use syntax::ast::{LitKind, NodeId};
use syntax::codemap::Span;
use syntax::source_map::Span;
use unicode_normalization::UnicodeNormalization;
use crate::utils::{is_allowed, snippet, span_help_and_lint};

Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/unsafe_removed_from_name.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use rustc::lint::*;
use rustc::{declare_lint, lint_array};
use syntax::ast::*;
use syntax::codemap::Span;
use syntax::source_map::Span;
use syntax::symbol::LocalInternedString;
use crate::utils::span_lint;

Expand Down
Loading

0 comments on commit 76321d3

Please sign in to comment.