From 9086b17e14d9a7c50065b72a626822ce488226d8 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Tue, 31 Dec 2019 09:17:56 +0900 Subject: [PATCH] Rustup to rust-lang/rust#67707 --- clippy_lints/src/attrs.rs | 2 +- clippy_lints/src/cognitive_complexity.rs | 2 +- clippy_lints/src/consts.rs | 2 +- clippy_lints/src/doc.rs | 2 +- clippy_lints/src/excessive_precision.rs | 2 +- clippy_lints/src/fallible_impl_from.rs | 2 +- clippy_lints/src/inherent_impl.rs | 2 +- clippy_lints/src/lib.rs | 4 ++-- clippy_lints/src/literal_representation.rs | 4 ++-- clippy_lints/src/loops.rs | 2 +- clippy_lints/src/methods/option_map_unwrap_or.rs | 2 +- clippy_lints/src/misc.rs | 2 +- clippy_lints/src/missing_const_for_fn.rs | 2 +- clippy_lints/src/mutable_debug_assertion.rs | 2 +- clippy_lints/src/needless_pass_by_value.rs | 2 +- clippy_lints/src/non_copy_const.rs | 2 +- clippy_lints/src/panic_unimplemented.rs | 2 +- clippy_lints/src/ptr.rs | 2 +- clippy_lints/src/returns.rs | 2 +- clippy_lints/src/slow_vector_initialization.rs | 2 +- clippy_lints/src/swap.rs | 2 +- clippy_lints/src/trivially_copy_pass_by_ref.rs | 2 +- clippy_lints/src/types.rs | 6 +++--- clippy_lints/src/use_self.rs | 2 +- clippy_lints/src/utils/attrs.rs | 2 +- clippy_lints/src/utils/internal_lints.rs | 2 +- clippy_lints/src/utils/mod.rs | 2 +- clippy_lints/src/utils/paths.rs | 2 +- clippy_lints/src/utils/sugg.rs | 2 +- clippy_lints/src/write.rs | 2 +- doc/adding_lints.md | 4 ++-- 31 files changed, 36 insertions(+), 36 deletions(-) diff --git a/clippy_lints/src/attrs.rs b/clippy_lints/src/attrs.rs index b618fcfd7b87..2336e1022d64 100644 --- a/clippy_lints/src/attrs.rs +++ b/clippy_lints/src/attrs.rs @@ -15,11 +15,11 @@ use rustc::lint::{ use rustc::ty; use rustc_errors::Applicability; use rustc_session::declare_tool_lint; +use rustc_span::symbol::Symbol; use semver::Version; use syntax::ast::{AttrKind, AttrStyle, Attribute, Lit, LitKind, MetaItemKind, NestedMetaItem}; use syntax::source_map::Span; use syntax::util::lev_distance::find_best_match_for_name; -use syntax_pos::symbol::Symbol; declare_clippy_lint! { /// **What it does:** Checks for items annotated with `#[inline(always)]`, diff --git a/clippy_lints/src/cognitive_complexity.rs b/clippy_lints/src/cognitive_complexity.rs index 083b20716f0c..6eb643c392d7 100644 --- a/clippy_lints/src/cognitive_complexity.rs +++ b/clippy_lints/src/cognitive_complexity.rs @@ -5,9 +5,9 @@ use rustc::hir::*; use rustc::impl_lint_pass; use rustc::lint::{LateContext, LateLintPass, LintArray, LintContext, LintPass}; use rustc_session::declare_tool_lint; +use rustc_span::BytePos; use syntax::ast::Attribute; use syntax::source_map::Span; -use syntax_pos::BytePos; use crate::utils::{match_type, paths, snippet_opt, span_help_and_lint, LimitStack}; diff --git a/clippy_lints/src/consts.rs b/clippy_lints/src/consts.rs index 540976a0fb90..331dd5cc0152 100644 --- a/clippy_lints/src/consts.rs +++ b/clippy_lints/src/consts.rs @@ -9,12 +9,12 @@ use rustc::ty::subst::{Subst, SubstsRef}; use rustc::ty::{self, Ty, TyCtxt}; use rustc::{bug, span_bug}; use rustc_data_structures::sync::Lrc; +use rustc_span::symbol::Symbol; use std::cmp::Ordering::{self, Equal}; use std::cmp::PartialOrd; use std::convert::TryInto; use std::hash::{Hash, Hasher}; use syntax::ast::{FloatTy, LitKind}; -use syntax_pos::symbol::Symbol; /// A `LitKind`-like enum to fold constant `Expr`s into. #[derive(Debug, Clone)] diff --git a/clippy_lints/src/doc.rs b/clippy_lints/src/doc.rs index d5caf7db989c..6b07ee32c52c 100644 --- a/clippy_lints/src/doc.rs +++ b/clippy_lints/src/doc.rs @@ -5,10 +5,10 @@ use rustc::impl_lint_pass; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc_data_structures::fx::FxHashSet; use rustc_session::declare_tool_lint; +use rustc_span::Pos; use std::ops::Range; use syntax::ast::{AttrKind, Attribute}; use syntax::source_map::{BytePos, MultiSpan, Span}; -use syntax_pos::Pos; use url::Url; declare_clippy_lint! { diff --git a/clippy_lints/src/excessive_precision.rs b/clippy_lints/src/excessive_precision.rs index f6dd026335c7..e3bbb94ef117 100644 --- a/clippy_lints/src/excessive_precision.rs +++ b/clippy_lints/src/excessive_precision.rs @@ -7,11 +7,11 @@ use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty; use rustc_errors::Applicability; use rustc_session::declare_tool_lint; +use rustc_span::symbol::Symbol; use std::f32; use std::f64; use std::fmt; use syntax::ast::*; -use syntax_pos::symbol::Symbol; declare_clippy_lint! { /// **What it does:** Checks for float literals with a precision greater diff --git a/clippy_lints/src/fallible_impl_from.rs b/clippy_lints/src/fallible_impl_from.rs index 71d0aba8acac..7584615aa2fc 100644 --- a/clippy_lints/src/fallible_impl_from.rs +++ b/clippy_lints/src/fallible_impl_from.rs @@ -6,7 +6,7 @@ use rustc::hir; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty::{self, Ty}; use rustc_session::declare_tool_lint; -use syntax_pos::Span; +use rustc_span::Span; declare_clippy_lint! { /// **What it does:** Checks for impls of `From<..>` that contain `panic!()` or `unwrap()` diff --git a/clippy_lints/src/inherent_impl.rs b/clippy_lints/src/inherent_impl.rs index 860c4e84eb36..73b8d14c5b14 100644 --- a/clippy_lints/src/inherent_impl.rs +++ b/clippy_lints/src/inherent_impl.rs @@ -6,7 +6,7 @@ use rustc::impl_lint_pass; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc_data_structures::fx::FxHashMap; use rustc_session::declare_tool_lint; -use syntax_pos::Span; +use rustc_span::Span; declare_clippy_lint! { /// **What it does:** Checks for multiple inherent implementations of a struct diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index 8b8f6b27a95d..49101695a58b 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -36,13 +36,13 @@ extern crate rustc_parse; #[allow(unused_extern_crates)] extern crate rustc_session; #[allow(unused_extern_crates)] +extern crate rustc_span; +#[allow(unused_extern_crates)] extern crate rustc_target; #[allow(unused_extern_crates)] extern crate rustc_typeck; #[allow(unused_extern_crates)] extern crate syntax; -#[allow(unused_extern_crates)] -extern crate syntax_pos; use rustc::lint::{self, LintId}; use rustc::session::Session; diff --git a/clippy_lints/src/literal_representation.rs b/clippy_lints/src/literal_representation.rs index 7852e7067601..95d13ae05ebf 100644 --- a/clippy_lints/src/literal_representation.rs +++ b/clippy_lints/src/literal_representation.rs @@ -330,7 +330,7 @@ enum WarningType { } impl WarningType { - fn display(&self, suggested_format: String, cx: &EarlyContext<'_>, span: syntax_pos::Span) { + fn display(&self, suggested_format: String, cx: &EarlyContext<'_>, span: rustc_span::Span) { match self { Self::MistypedLiteralSuffix => span_lint_and_sugg( cx, @@ -450,7 +450,7 @@ impl LiteralDigitGrouping { // Returns `false` if the check fails fn check_for_mistyped_suffix( cx: &EarlyContext<'_>, - span: syntax_pos::Span, + span: rustc_span::Span, num_lit: &mut NumericLiteral<'_>, ) -> bool { if num_lit.suffix.is_some() { diff --git a/clippy_lints/src/loops.rs b/clippy_lints/src/loops.rs index 7fb924ee75f6..c4061a3e330a 100644 --- a/clippy_lints/src/loops.rs +++ b/clippy_lints/src/loops.rs @@ -17,12 +17,12 @@ use rustc::ty::subst::Subst; use rustc::ty::{self, Ty}; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_errors::Applicability; +use rustc_span::{BytePos, Symbol}; use rustc_typeck::expr_use_visitor::*; use std::iter::{once, Iterator}; use std::mem; use syntax::ast; use syntax::source_map::Span; -use syntax_pos::{BytePos, Symbol}; use crate::utils::paths; use crate::utils::{ diff --git a/clippy_lints/src/methods/option_map_unwrap_or.rs b/clippy_lints/src/methods/option_map_unwrap_or.rs index f4aaf959be18..5a47f7d24619 100644 --- a/clippy_lints/src/methods/option_map_unwrap_or.rs +++ b/clippy_lints/src/methods/option_map_unwrap_or.rs @@ -5,8 +5,8 @@ use rustc::hir::{self, *}; use rustc::lint::LateContext; use rustc_data_structures::fx::FxHashSet; use rustc_errors::Applicability; +use rustc_span::symbol::Symbol; use syntax::source_map::Span; -use syntax_pos::symbol::Symbol; use super::OPTION_MAP_UNWRAP_OR; diff --git a/clippy_lints/src/misc.rs b/clippy_lints/src/misc.rs index 248b6e4229a4..289295c43a12 100644 --- a/clippy_lints/src/misc.rs +++ b/clippy_lints/src/misc.rs @@ -603,7 +603,7 @@ fn is_used(cx: &LateContext<'_, '_>, expr: &Expr<'_>) -> bool { /// Tests whether an expression is in a macro expansion (e.g., something /// generated by `#[derive(...)]` or the like). fn in_attributes_expansion(expr: &Expr<'_>) -> bool { - use syntax_pos::hygiene::MacroKind; + use rustc_span::hygiene::MacroKind; if expr.span.from_expansion() { let data = expr.span.ctxt().outer_expn_data(); diff --git a/clippy_lints/src/missing_const_for_fn.rs b/clippy_lints/src/missing_const_for_fn.rs index cbfbc6988520..cddcba3cb010 100644 --- a/clippy_lints/src/missing_const_for_fn.rs +++ b/clippy_lints/src/missing_const_for_fn.rs @@ -6,8 +6,8 @@ use rustc::hir::{Body, Constness, FnDecl, HirId}; use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintPass}; use rustc_mir::transform::qualify_min_const_fn::is_min_const_fn; use rustc_session::declare_tool_lint; +use rustc_span::Span; use rustc_typeck::hir_ty_to_ty; -use syntax_pos::Span; declare_clippy_lint! { /// **What it does:** diff --git a/clippy_lints/src/mutable_debug_assertion.rs b/clippy_lints/src/mutable_debug_assertion.rs index 5844de136b91..9a18bce9f2f4 100644 --- a/clippy_lints/src/mutable_debug_assertion.rs +++ b/clippy_lints/src/mutable_debug_assertion.rs @@ -6,7 +6,7 @@ use rustc::hir::{BorrowKind, Expr, ExprKind, Mutability, StmtKind, UnOp}; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::{declare_lint_pass, ty}; use rustc_session::declare_tool_lint; -use syntax_pos::Span; +use rustc_span::Span; declare_clippy_lint! { /// **What it does:** Checks for function/method calls with a mutable diff --git a/clippy_lints/src/needless_pass_by_value.rs b/clippy_lints/src/needless_pass_by_value.rs index eaae13377ac5..4be858be3772 100644 --- a/clippy_lints/src/needless_pass_by_value.rs +++ b/clippy_lints/src/needless_pass_by_value.rs @@ -14,12 +14,12 @@ use rustc::ty::{self, RegionKind, TypeFoldable}; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_errors::Applicability; use rustc_session::declare_tool_lint; +use rustc_span::{Span, Symbol}; use rustc_target::spec::abi::Abi; use rustc_typeck::expr_use_visitor as euv; use std::borrow::Cow; use syntax::ast::Attribute; use syntax::errors::DiagnosticBuilder; -use syntax_pos::{Span, Symbol}; declare_clippy_lint! { /// **What it does:** Checks for functions taking arguments by value, but not diff --git a/clippy_lints/src/non_copy_const.rs b/clippy_lints/src/non_copy_const.rs index b454cfbac671..e671f31ca6fb 100644 --- a/clippy_lints/src/non_copy_const.rs +++ b/clippy_lints/src/non_copy_const.rs @@ -11,8 +11,8 @@ use rustc::lint::{LateContext, LateLintPass, Lint, LintArray, LintPass}; use rustc::ty::adjustment::Adjust; use rustc::ty::{Ty, TypeFlags}; use rustc_session::declare_tool_lint; +use rustc_span::{InnerSpan, Span, DUMMY_SP}; use rustc_typeck::hir_ty_to_ty; -use syntax_pos::{InnerSpan, Span, DUMMY_SP}; use crate::utils::{in_constant, is_copy, qpath_res, span_lint_and_then}; diff --git a/clippy_lints/src/panic_unimplemented.rs b/clippy_lints/src/panic_unimplemented.rs index e63bfd0135fb..93c0cbff07aa 100644 --- a/clippy_lints/src/panic_unimplemented.rs +++ b/clippy_lints/src/panic_unimplemented.rs @@ -4,8 +4,8 @@ use rustc::declare_lint_pass; use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc_session::declare_tool_lint; +use rustc_span::Span; use syntax::ast::LitKind; -use syntax_pos::Span; declare_clippy_lint! { /// **What it does:** Checks for missing parameters in `panic!`. diff --git a/clippy_lints/src/ptr.rs b/clippy_lints/src/ptr.rs index ff21a72e3bac..db7fbf7083dd 100644 --- a/clippy_lints/src/ptr.rs +++ b/clippy_lints/src/ptr.rs @@ -13,9 +13,9 @@ use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty; use rustc_errors::Applicability; use rustc_session::declare_tool_lint; +use rustc_span::{MultiSpan, Symbol}; use std::borrow::Cow; use syntax::source_map::Span; -use syntax_pos::{MultiSpan, Symbol}; declare_clippy_lint! { /// **What it does:** This lint checks for function arguments of type `&String` diff --git a/clippy_lints/src/returns.rs b/clippy_lints/src/returns.rs index c3afa156017d..9fb2caaefbdf 100644 --- a/clippy_lints/src/returns.rs +++ b/clippy_lints/src/returns.rs @@ -3,10 +3,10 @@ use rustc::declare_lint_pass; use rustc::lint::{in_external_macro, EarlyContext, EarlyLintPass, LintArray, LintContext, LintPass}; use rustc_errors::Applicability; use rustc_session::declare_tool_lint; +use rustc_span::BytePos; use syntax::ast; use syntax::source_map::Span; use syntax::visit::FnKind; -use syntax_pos::BytePos; use crate::utils::{match_path_ast, snippet_opt, span_lint_and_then}; diff --git a/clippy_lints/src/slow_vector_initialization.rs b/clippy_lints/src/slow_vector_initialization.rs index 03becd1c7c10..f9e4e75a22bd 100644 --- a/clippy_lints/src/slow_vector_initialization.rs +++ b/clippy_lints/src/slow_vector_initialization.rs @@ -7,8 +7,8 @@ use rustc::hir::*; use rustc::lint::{LateContext, LateLintPass, Lint, LintArray, LintPass}; use rustc_errors::Applicability; use rustc_session::declare_tool_lint; +use rustc_span::symbol::Symbol; use syntax::ast::LitKind; -use syntax_pos::symbol::Symbol; declare_clippy_lint! { /// **What it does:** Checks slow zero-filled vector initialization diff --git a/clippy_lints/src/swap.rs b/clippy_lints/src/swap.rs index c4282dde585e..fb3d7ecafc2a 100644 --- a/clippy_lints/src/swap.rs +++ b/clippy_lints/src/swap.rs @@ -11,7 +11,7 @@ use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::ty; use rustc_errors::Applicability; use rustc_session::declare_tool_lint; -use syntax_pos::Symbol; +use rustc_span::Symbol; declare_clippy_lint! { /// **What it does:** Checks for manual swapping. diff --git a/clippy_lints/src/trivially_copy_pass_by_ref.rs b/clippy_lints/src/trivially_copy_pass_by_ref.rs index 1359fa331b6c..04f9c47fa77a 100644 --- a/clippy_lints/src/trivially_copy_pass_by_ref.rs +++ b/clippy_lints/src/trivially_copy_pass_by_ref.rs @@ -12,9 +12,9 @@ use rustc::session::config::Config as SessionConfig; use rustc::ty; use rustc_errors::Applicability; use rustc_session::declare_tool_lint; +use rustc_span::Span; use rustc_target::abi::LayoutOf; use rustc_target::spec::abi::Abi; -use syntax_pos::Span; declare_clippy_lint! { /// **What it does:** Checks for functions taking arguments by reference, where diff --git a/clippy_lints/src/types.rs b/clippy_lints/src/types.rs index d282987b30ef..3f865ff49713 100644 --- a/clippy_lints/src/types.rs +++ b/clippy_lints/src/types.rs @@ -14,13 +14,13 @@ use rustc::ty::{self, InferTy, Ty, TyCtxt, TypeckTables}; use rustc::{declare_lint_pass, impl_lint_pass}; use rustc_errors::Applicability; use rustc_session::declare_tool_lint; +use rustc_span::hygiene::{ExpnKind, MacroKind}; use rustc_target::spec::abi::Abi; use rustc_typeck::hir_ty_to_ty; use syntax::ast::{FloatTy, IntTy, LitFloatType, LitIntType, LitKind, UintTy}; use syntax::errors::DiagnosticBuilder; use syntax::source_map::Span; use syntax::symbol::{sym, Symbol}; -use syntax_pos::hygiene::{ExpnKind, MacroKind}; use crate::consts::{constant, Constant}; use crate::utils::paths; @@ -668,7 +668,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnitArg { } fn is_questionmark_desugar_marked_call(expr: &Expr<'_>) -> bool { - use syntax_pos::hygiene::DesugaringKind; + use rustc_span::hygiene::DesugaringKind; if let ExprKind::Call(ref callee, _) = expr.kind { callee.span.is_desugaring(DesugaringKind::QuestionMark) } else { @@ -2045,7 +2045,7 @@ declare_lint_pass!(ImplicitHasher => [IMPLICIT_HASHER]); impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ImplicitHasher { #[allow(clippy::cast_possible_truncation, clippy::too_many_lines)] fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item<'_>) { - use syntax_pos::BytePos; + use rustc_span::BytePos; fn suggestion<'a, 'tcx>( cx: &LateContext<'a, 'tcx>, diff --git a/clippy_lints/src/use_self.rs b/clippy_lints/src/use_self.rs index d06ed77c2299..4f3b2c188ea7 100644 --- a/clippy_lints/src/use_self.rs +++ b/clippy_lints/src/use_self.rs @@ -9,7 +9,7 @@ use rustc::ty; use rustc::ty::{DefIdTree, Ty}; use rustc_errors::Applicability; use rustc_session::declare_tool_lint; -use syntax_pos::symbol::kw; +use rustc_span::symbol::kw; use crate::utils::{differing_macro_contexts, span_lint_and_sugg}; diff --git a/clippy_lints/src/utils/attrs.rs b/clippy_lints/src/utils/attrs.rs index 19dbae2eabd9..8f886d174f1e 100644 --- a/clippy_lints/src/utils/attrs.rs +++ b/clippy_lints/src/utils/attrs.rs @@ -123,7 +123,7 @@ fn parse_attrs(sess: &Session, attrs: &[ast::Attribute], name: &' /// Return true if the attributes contain any of `proc_macro`, /// `proc_macro_derive` or `proc_macro_attribute`, false otherwise pub fn is_proc_macro(attrs: &[ast::Attribute]) -> bool { - use syntax_pos::Symbol; + use rustc_span::Symbol; let syms = [ Symbol::intern("proc_macro"), diff --git a/clippy_lints/src/utils/internal_lints.rs b/clippy_lints/src/utils/internal_lints.rs index 4af825816439..c61b6faa9325 100644 --- a/clippy_lints/src/utils/internal_lints.rs +++ b/clippy_lints/src/utils/internal_lints.rs @@ -12,11 +12,11 @@ use rustc::{declare_lint_pass, impl_lint_pass}; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_errors::Applicability; use rustc_session::declare_tool_lint; +use rustc_span::symbol::SymbolStr; use syntax::ast; use syntax::ast::{Crate as AstCrate, ItemKind, Name}; use syntax::source_map::Span; use syntax::visit::FnKind; -use syntax_pos::symbol::SymbolStr; declare_clippy_lint! { /// **What it does:** Checks for various things we like to keep tidy in clippy. diff --git a/clippy_lints/src/utils/mod.rs b/clippy_lints/src/utils/mod.rs index ae0cc8e4a088..ebfa88fabfd6 100644 --- a/clippy_lints/src/utils/mod.rs +++ b/clippy_lints/src/utils/mod.rs @@ -40,12 +40,12 @@ use rustc::ty::{ Binder, Ty, TyCtxt, }; use rustc_errors::Applicability; +use rustc_span::hygiene::ExpnKind; use smallvec::SmallVec; use syntax::ast::{self, Attribute, LitKind}; use syntax::attr; use syntax::source_map::{Span, DUMMY_SP}; use syntax::symbol::{kw, Symbol}; -use syntax_pos::hygiene::ExpnKind; use crate::consts::{constant, Constant}; use crate::reexport::*; diff --git a/clippy_lints/src/utils/paths.rs b/clippy_lints/src/utils/paths.rs index 86648f9d3cc2..9338daf05741 100644 --- a/clippy_lints/src/utils/paths.rs +++ b/clippy_lints/src/utils/paths.rs @@ -104,7 +104,7 @@ pub const STD_CONVERT_IDENTITY: [&str; 3] = ["std", "convert", "identity"]; pub const STD_MEM_TRANSMUTE: [&str; 3] = ["std", "mem", "transmute"]; pub const STD_PTR_NULL: [&str; 3] = ["std", "ptr", "null"]; pub const STRING: [&str; 3] = ["alloc", "string", "String"]; -pub const SYNTAX_CONTEXT: [&str; 3] = ["syntax_pos", "hygiene", "SyntaxContext"]; +pub const SYNTAX_CONTEXT: [&str; 3] = ["rustc_span", "hygiene", "SyntaxContext"]; pub const TO_OWNED: [&str; 3] = ["alloc", "borrow", "ToOwned"]; pub const TO_OWNED_METHOD: [&str; 4] = ["alloc", "borrow", "ToOwned", "to_owned"]; pub const TO_STRING: [&str; 3] = ["alloc", "string", "ToString"]; diff --git a/clippy_lints/src/utils/sugg.rs b/clippy_lints/src/utils/sugg.rs index 94e09e95f73d..a817d2a9e860 100644 --- a/clippy_lints/src/utils/sugg.rs +++ b/clippy_lints/src/utils/sugg.rs @@ -6,6 +6,7 @@ use matches::matches; use rustc::hir; use rustc::lint::{EarlyContext, LateContext, LintContext}; use rustc_errors::Applicability; +use rustc_span::{BytePos, Pos}; use std::borrow::Cow; use std::convert::TryInto; use std::fmt::Display; @@ -14,7 +15,6 @@ use syntax::print::pprust::token_kind_to_string; use syntax::source_map::{CharPos, Span}; use syntax::token; use syntax::util::parser::AssocOp; -use syntax_pos::{BytePos, Pos}; pub use crate::literal_representation::format_numeric_literal; diff --git a/clippy_lints/src/write.rs b/clippy_lints/src/write.rs index 57ccd5ea1904..7d492783bda9 100644 --- a/clippy_lints/src/write.rs +++ b/clippy_lints/src/write.rs @@ -8,11 +8,11 @@ use rustc_errors::Applicability; use rustc_lexer::unescape::{self, EscapeError}; use rustc_parse::parser; use rustc_session::declare_tool_lint; +use rustc_span::{BytePos, Span}; use syntax::ast::*; use syntax::symbol::Symbol; use syntax::token; use syntax::tokenstream::TokenStream; -use syntax_pos::{BytePos, Span}; declare_clippy_lint! { /// **What it does:** This lint warns when you use `println!("")` to diff --git a/doc/adding_lints.md b/doc/adding_lints.md index 36d0ce0207f6..f140950e47fe 100644 --- a/doc/adding_lints.md +++ b/doc/adding_lints.md @@ -432,12 +432,12 @@ don't hesitate to ask on Discord, IRC or in the issue/PR. [diagnostics]: https://github.com/rust-lang/rust-clippy/blob/master/clippy_lints/src/utils/diagnostics.rs [utils]: https://github.com/rust-lang/rust-clippy/blob/master/clippy_lints/src/utils/mod.rs [ident]: https://doc.rust-lang.org/nightly/nightly-rustc/syntax/source_map/symbol/struct.Ident.html -[span]: https://doc.rust-lang.org/nightly/nightly-rustc/syntax_pos/struct.Span.html +[span]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_span/struct.Span.html [applicability]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_errors/enum.Applicability.html [if_chain]: https://docs.rs/if_chain/*/if_chain/ [ty]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ty/sty/index.html [ast]: https://doc.rust-lang.org/nightly/nightly-rustc/syntax/ast/index.html -[from_expansion]: https://doc.rust-lang.org/nightly/nightly-rustc/syntax_pos/struct.Span.html#method.from_expansion +[from_expansion]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_span/struct.Span.html#method.from_expansion [in_external_macro]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc/lint/fn.in_external_macro.html [play]: https://play.rust-lang.org [author_example]: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=f093b986e80ad62f3b67a1f24f5e66e2