Skip to content

Rustup to rust-lang/rust#67707 #4973

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 31, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -104,6 +104,8 @@ matrix:
allow_failures:
- os: windows
env: CARGO_INCREMENTAL=0 OS_WINDOWS=true
# FIXME: Remove this once rls gets rustup
- env: INTEGRATION=rust-lang/rls

before_script:
- |
2 changes: 1 addition & 1 deletion clippy_lints/src/attrs.rs
Original file line number Diff line number Diff line change
@@ -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)]`,
2 changes: 1 addition & 1 deletion clippy_lints/src/cognitive_complexity.rs
Original file line number Diff line number Diff line change
@@ -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};

2 changes: 1 addition & 1 deletion clippy_lints/src/consts.rs
Original file line number Diff line number Diff line change
@@ -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)]
2 changes: 1 addition & 1 deletion clippy_lints/src/doc.rs
Original file line number Diff line number Diff line change
@@ -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! {
2 changes: 1 addition & 1 deletion clippy_lints/src/excessive_precision.rs
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion clippy_lints/src/fallible_impl_from.rs
Original file line number Diff line number Diff line change
@@ -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()`
4 changes: 2 additions & 2 deletions clippy_lints/src/inherent_impl.rs
Original file line number Diff line number Diff line change
@@ -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
@@ -54,7 +54,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MultipleInherentImpl {
// Remember for each inherent implementation encoutered its span and generics
// but filter out implementations that have generic params (type or lifetime)
// or are derived from a macro
if !in_macro(item.span) && generics.params.len() == 0 {
if !in_macro(item.span) && generics.params.is_empty() {
self.impls.insert(item.hir_id.owner_def_id(), item.span);
}
}
4 changes: 2 additions & 2 deletions clippy_lints/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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;
4 changes: 2 additions & 2 deletions clippy_lints/src/literal_representation.rs
Original file line number Diff line number Diff line change
@@ -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() {
2 changes: 1 addition & 1 deletion clippy_lints/src/loops.rs
Original file line number Diff line number Diff line change
@@ -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::{
2 changes: 1 addition & 1 deletion clippy_lints/src/methods/option_map_unwrap_or.rs
Original file line number Diff line number Diff line change
@@ -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;

2 changes: 1 addition & 1 deletion clippy_lints/src/misc.rs
Original file line number Diff line number Diff line change
@@ -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();

2 changes: 1 addition & 1 deletion clippy_lints/src/missing_const_for_fn.rs
Original file line number Diff line number Diff line change
@@ -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:**
2 changes: 1 addition & 1 deletion clippy_lints/src/mutable_debug_assertion.rs
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion clippy_lints/src/needless_pass_by_value.rs
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion clippy_lints/src/non_copy_const.rs
Original file line number Diff line number Diff line change
@@ -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};

2 changes: 1 addition & 1 deletion clippy_lints/src/panic_unimplemented.rs
Original file line number Diff line number Diff line change
@@ -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!`.
2 changes: 1 addition & 1 deletion clippy_lints/src/ptr.rs
Original file line number Diff line number Diff line change
@@ -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`
2 changes: 1 addition & 1 deletion clippy_lints/src/returns.rs
Original file line number Diff line number Diff line change
@@ -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};

2 changes: 1 addition & 1 deletion clippy_lints/src/slow_vector_initialization.rs
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion clippy_lints/src/swap.rs
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion clippy_lints/src/trivially_copy_pass_by_ref.rs
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions clippy_lints/src/types.rs
Original file line number Diff line number Diff line change
@@ -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>,
2 changes: 1 addition & 1 deletion clippy_lints/src/use_self.rs
Original file line number Diff line number Diff line change
@@ -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};

2 changes: 1 addition & 1 deletion clippy_lints/src/utils/attrs.rs
Original file line number Diff line number Diff line change
@@ -123,7 +123,7 @@ fn parse_attrs<F: FnMut(u64)>(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"),
2 changes: 1 addition & 1 deletion clippy_lints/src/utils/internal_lints.rs
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion clippy_lints/src/utils/mod.rs
Original file line number Diff line number Diff line change
@@ -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::*;
2 changes: 1 addition & 1 deletion clippy_lints/src/utils/paths.rs
Original file line number Diff line number Diff line change
@@ -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"];
2 changes: 1 addition & 1 deletion clippy_lints/src/utils/sugg.rs
Original file line number Diff line number Diff line change
@@ -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;

2 changes: 1 addition & 1 deletion clippy_lints/src/write.rs
Original file line number Diff line number Diff line change
@@ -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
Loading