From 1712e18b775cb1618c17c9b029d0493c59929ce3 Mon Sep 17 00:00:00 2001 From: Philipp Hansch Date: Sat, 28 Apr 2018 12:56:31 +0200 Subject: [PATCH] Rustup to latest nightly Due to https://github.com/rust-lang/rust/pull/48995 and https://github.com/rust-lang/rust/pull/49894 --- clippy_lints/src/copies.rs | 6 +++--- clippy_lints/src/enum_variants.rs | 6 +++--- clippy_lints/src/non_expressive_names.rs | 4 ++-- clippy_lints/src/unsafe_removed_from_name.rs | 4 ++-- clippy_lints/src/unused_label.rs | 4 ++-- clippy_lints/src/utils/internal_lints.rs | 4 ++-- clippy_lints/src/utils/mod.rs | 4 ++-- clippy_lints/src/write.rs | 8 ++++---- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/clippy_lints/src/copies.rs b/clippy_lints/src/copies.rs index 1434a1437..5cbf7d031 100644 --- a/clippy_lints/src/copies.rs +++ b/clippy_lints/src/copies.rs @@ -3,7 +3,7 @@ use rustc::ty::Ty; use rustc::hir::*; use std::collections::HashMap; use std::collections::hash_map::Entry; -use syntax::symbol::InternedString; +use syntax::symbol::LocalInternedString; use syntax::util::small_vector::SmallVector; use utils::{SpanlessEq, SpanlessHash}; use utils::{get_parent_expr, in_macro, snippet, span_lint_and_then, span_note_and_lint}; @@ -262,8 +262,8 @@ fn if_sequence(mut expr: &Expr) -> (SmallVector<&Expr>, SmallVector<&Block>) { } /// Return the list of bindings in a pattern. -fn bindings<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, pat: &Pat) -> HashMap> { - fn bindings_impl<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, pat: &Pat, map: &mut HashMap>) { +fn bindings<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, pat: &Pat) -> HashMap> { + fn bindings_impl<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, pat: &Pat, map: &mut HashMap>) { match pat.node { PatKind::Box(ref pat) | PatKind::Ref(ref pat, _) => bindings_impl(cx, pat, map), PatKind::TupleStruct(_, ref pats, _) => for pat in pats { diff --git a/clippy_lints/src/enum_variants.rs b/clippy_lints/src/enum_variants.rs index e769c2acc..860cd6930 100644 --- a/clippy_lints/src/enum_variants.rs +++ b/clippy_lints/src/enum_variants.rs @@ -3,7 +3,7 @@ use rustc::lint::*; use syntax::ast::*; use syntax::codemap::Span; -use syntax::symbol::InternedString; +use syntax::symbol::LocalInternedString; use utils::{span_help_and_lint, span_lint}; use utils::{camel_case_from, camel_case_until, in_macro}; @@ -99,7 +99,7 @@ declare_clippy_lint! { } pub struct EnumVariantNames { - modules: Vec<(InternedString, String)>, + modules: Vec<(LocalInternedString, String)>, threshold: u64, } @@ -118,7 +118,7 @@ impl LintPass for EnumVariantNames { } } -fn var2str(var: &Variant) -> InternedString { +fn var2str(var: &Variant) -> LocalInternedString { var.node.ident.name.as_str() } diff --git a/clippy_lints/src/non_expressive_names.rs b/clippy_lints/src/non_expressive_names.rs index 394bc4bcf..022591329 100644 --- a/clippy_lints/src/non_expressive_names.rs +++ b/clippy_lints/src/non_expressive_names.rs @@ -1,6 +1,6 @@ use rustc::lint::*; use syntax::codemap::Span; -use syntax::symbol::InternedString; +use syntax::symbol::LocalInternedString; use syntax::ast::*; use syntax::attr; use syntax::visit::{walk_block, walk_expr, walk_pat, Visitor}; @@ -73,7 +73,7 @@ impl LintPass for NonExpressiveNames { } struct ExistingName { - interned: InternedString, + interned: LocalInternedString, span: Span, len: usize, whitelist: &'static [&'static str], diff --git a/clippy_lints/src/unsafe_removed_from_name.rs b/clippy_lints/src/unsafe_removed_from_name.rs index 8ecc95fb7..ff460e50d 100644 --- a/clippy_lints/src/unsafe_removed_from_name.rs +++ b/clippy_lints/src/unsafe_removed_from_name.rs @@ -1,7 +1,7 @@ use rustc::lint::*; use syntax::ast::*; use syntax::codemap::Span; -use syntax::symbol::InternedString; +use syntax::symbol::LocalInternedString; use utils::span_lint; /// **What it does:** Checks for imports that remove "unsafe" from an item's @@ -75,6 +75,6 @@ fn unsafe_to_safe_check(old_name: Ident, new_name: Ident, cx: &EarlyContext, spa } } -fn contains_unsafe(name: &InternedString) -> bool { +fn contains_unsafe(name: &LocalInternedString) -> bool { name.contains("Unsafe") || name.contains("unsafe") } diff --git a/clippy_lints/src/unused_label.rs b/clippy_lints/src/unused_label.rs index b009420bd..7e3f31d76 100644 --- a/clippy_lints/src/unused_label.rs +++ b/clippy_lints/src/unused_label.rs @@ -4,7 +4,7 @@ use rustc::hir::intravisit::{walk_expr, walk_fn, FnKind, NestedVisitorMap, Visit use std::collections::HashMap; use syntax::ast; use syntax::codemap::Span; -use syntax::symbol::InternedString; +use syntax::symbol::LocalInternedString; use utils::{in_macro, span_lint}; /// **What it does:** Checks for unused labels. @@ -30,7 +30,7 @@ declare_clippy_lint! { pub struct UnusedLabel; struct UnusedLabelVisitor<'a, 'tcx: 'a> { - labels: HashMap, + labels: HashMap, cx: &'a LateContext<'a, 'tcx>, } diff --git a/clippy_lints/src/utils/internal_lints.rs b/clippy_lints/src/utils/internal_lints.rs index 666db3e06..5c9500afa 100644 --- a/clippy_lints/src/utils/internal_lints.rs +++ b/clippy_lints/src/utils/internal_lints.rs @@ -2,7 +2,7 @@ use rustc::lint::*; use rustc::hir::*; use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor}; use utils::{match_qpath, paths, span_lint}; -use syntax::symbol::InternedString; +use syntax::symbol::LocalInternedString; use syntax::ast::{Crate as AstCrate, ItemKind, Name, NodeId}; use syntax::codemap::Span; use std::collections::{HashMap, HashSet}; @@ -76,7 +76,7 @@ impl EarlyLintPass for Clippy { .find(|item| item.ident.name == "paths") { if let ItemKind::Mod(ref paths_mod) = paths.node { - let mut last_name: Option = None; + let mut last_name: Option = None; for item in &paths_mod.items { let name = item.ident.name.as_str(); if let Some(ref last_name) = last_name { diff --git a/clippy_lints/src/utils/mod.rs b/clippy_lints/src/utils/mod.rs index 39df36980..6701ad007 100644 --- a/clippy_lints/src/utils/mod.rs +++ b/clippy_lints/src/utils/mod.rs @@ -116,7 +116,7 @@ pub fn match_def_path(tcx: TyCtxt, def_id: DefId, path: &[&str]) -> bool { use syntax::symbol; struct AbsolutePathBuffer { - names: Vec, + names: Vec, } impl ty::item_path::ItemPathBuffer for AbsolutePathBuffer { @@ -302,7 +302,7 @@ pub fn implements_trait<'a, 'tcx>( cx.tcx .predicate_for_trait_def(cx.param_env, traits::ObligationCause::dummy(), trait_id, 0, ty, ty_params); cx.tcx.infer_ctxt().enter(|infcx| { - traits::SelectionContext::new(&infcx).evaluate_obligation_conservatively(&obligation) + traits::SelectionContext::new(&infcx).infcx().predicate_must_hold(&obligation) }) } diff --git a/clippy_lints/src/write.rs b/clippy_lints/src/write.rs index 67c72bd98..9a32d4e69 100644 --- a/clippy_lints/src/write.rs +++ b/clippy_lints/src/write.rs @@ -4,7 +4,7 @@ use rustc::lint::*; use std::ops::Deref; use syntax::ast::LitKind; use syntax::ptr; -use syntax::symbol::InternedString; +use syntax::symbol::LocalInternedString; use syntax_pos::Span; use utils::{is_expn_of, match_def_path, match_path, resolve_node, span_lint, span_lint_and_sugg}; use utils::{opt_def_id, paths, last_path_segment}; @@ -389,7 +389,7 @@ where } /// Check for fmtstr = "... \n" -fn has_newline_end(args: &HirVec, fmtstr: InternedString, fmtlen: usize) -> bool { +fn has_newline_end(args: &HirVec, fmtstr: LocalInternedString, fmtlen: usize) -> bool { if_chain! { // check the final format string part if let Some('\n') = fmtstr.chars().last(); @@ -407,7 +407,7 @@ fn has_newline_end(args: &HirVec, fmtstr: InternedString, fmtlen: usize) - } /// Check for writeln!(v, "") / println!("") -fn has_empty_arg<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, span: Span, fmtstr: InternedString, fmtlen: usize) -> Option { +fn has_empty_arg<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, span: Span, fmtstr: LocalInternedString, fmtlen: usize) -> Option { if_chain! { // check that the string is empty if fmtlen == 1; @@ -427,7 +427,7 @@ fn has_empty_arg<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, span: Span, fmtstr: Inter } /// Returns the slice of format string parts in an `Arguments::new_v1` call. -fn get_argument_fmtstr_parts(expr: &Expr) -> Option<(InternedString, usize)> { +fn get_argument_fmtstr_parts(expr: &Expr) -> Option<(LocalInternedString, usize)> { if_chain! { if let ExprAddrOf(_, ref expr) = expr.node; // &["…", "…", …] if let ExprArray(ref exprs) = expr.node;