From a902e3fd715d01c05568f9f9e99e9311b9653c48 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Wed, 6 Nov 2019 06:24:47 +0000 Subject: [PATCH 1/5] rustup https://github.com/rust-lang/rust/pull/66014 --- tests/ui/builtin-type-shadow.stderr | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/ui/builtin-type-shadow.stderr b/tests/ui/builtin-type-shadow.stderr index c19ea6114f85..42bde5e07f36 100644 --- a/tests/ui/builtin-type-shadow.stderr +++ b/tests/ui/builtin-type-shadow.stderr @@ -10,9 +10,11 @@ error[E0308]: mismatched types --> $DIR/builtin-type-shadow.rs:5:5 | LL | fn foo(a: u32) -> u32 { - | --- expected `u32` because of return type + | --- --- expected `u32` because of return type + | | + | this type parameter LL | 42 - | ^^ expected type parameter, found integer + | ^^ expected type parameter `u32`, found integer | = note: expected type `u32` found type `{integer}` From 3e1760cb048e636c382ef70d7df05e7e7880205e Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Wed, 6 Nov 2019 13:27:39 +0700 Subject: [PATCH 2/5] build: re-enable stdsimd integration test Also sorting rls to the first in the list because it is now the longest running test. --- .travis.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6ab711b723b0..b07ebe501c76 100644 --- a/.travis.yml +++ b/.travis.yml @@ -56,15 +56,15 @@ matrix: # We don't want to run these always because they go towards # the build limit within the Travis rust-lang account. # The jobs are approximately sorted by execution time + - env: INTEGRATION=rust-lang/rls + if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try) - env: INTEGRATION=rust-lang/cargo if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try) - env: INTEGRATION=rust-lang-nursery/chalk if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try) - - env: INTEGRATION=rust-lang/rls - if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try) - env: INTEGRATION=Geal/nom if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try) - # FIXME blocked on https://github.com/rust-lang/rust-clippy/issues/4742 + # FIXME blocked on https://github.com/rust-lang/rust-clippy/issues/4727 #- env: INTEGRATION=rust-lang/rustfmt # if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try) - env: INTEGRATION=hyperium/hyper @@ -90,7 +90,6 @@ matrix: allow_failures: - os: windows env: CARGO_INCREMENTAL=0 OS_WINDOWS=true - - env: INTEGRATION=rust-lang-nursery/stdsimd before_script: - | From 51632530d78598a91ab935cd09c4eca3b2097269 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Wed, 6 Nov 2019 16:50:24 +0700 Subject: [PATCH 3/5] rustup rust-lang/rust#65776 --- clippy_lints/src/methods/mod.rs | 6 +++--- clippy_lints/src/non_expressive_names.rs | 4 ++-- clippy_lints/src/path_buf_push_overwrite.rs | 2 +- clippy_lints/src/unsafe_removed_from_name.rs | 4 ++-- clippy_lints/src/utils/internal_lints.rs | 8 ++++---- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/clippy_lints/src/methods/mod.rs b/clippy_lints/src/methods/mod.rs index e7b07bb1c1b6..db94d9dcdafa 100644 --- a/clippy_lints/src/methods/mod.rs +++ b/clippy_lints/src/methods/mod.rs @@ -17,7 +17,7 @@ use rustc::{declare_lint_pass, declare_tool_lint}; use rustc_errors::Applicability; use syntax::ast; use syntax::source_map::Span; -use syntax::symbol::{sym, LocalInternedString, Symbol}; +use syntax::symbol::{sym, Symbol, SymbolStr}; use crate::utils::usage::mutated_variables; use crate::utils::{ @@ -1148,8 +1148,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Methods { } let (method_names, arg_lists, method_spans) = method_calls(expr, 2); - let method_names: Vec = method_names.iter().map(|s| s.as_str()).collect(); - let method_names: Vec<&str> = method_names.iter().map(std::convert::AsRef::as_ref).collect(); + let method_names: Vec = method_names.iter().map(|s| s.as_str()).collect(); + let method_names: Vec<&str> = method_names.iter().map(|s| &**s).collect(); match method_names.as_slice() { ["unwrap", "get"] => lint_get_unwrap(cx, expr, arg_lists[1], false), diff --git a/clippy_lints/src/non_expressive_names.rs b/clippy_lints/src/non_expressive_names.rs index 08a78b784ba5..12df9325650f 100644 --- a/clippy_lints/src/non_expressive_names.rs +++ b/clippy_lints/src/non_expressive_names.rs @@ -5,7 +5,7 @@ use std::cmp::Ordering; use syntax::ast::*; use syntax::attr; use syntax::source_map::Span; -use syntax::symbol::LocalInternedString; +use syntax::symbol::SymbolStr; use syntax::visit::{walk_block, walk_expr, walk_pat, Visitor}; declare_clippy_lint! { @@ -72,7 +72,7 @@ pub struct NonExpressiveNames { impl_lint_pass!(NonExpressiveNames => [SIMILAR_NAMES, MANY_SINGLE_CHAR_NAMES, JUST_UNDERSCORES_AND_DIGITS]); struct ExistingName { - interned: LocalInternedString, + interned: SymbolStr, span: Span, len: usize, whitelist: &'static [&'static str], diff --git a/clippy_lints/src/path_buf_push_overwrite.rs b/clippy_lints/src/path_buf_push_overwrite.rs index 464845c3c741..eee60e33bab6 100644 --- a/clippy_lints/src/path_buf_push_overwrite.rs +++ b/clippy_lints/src/path_buf_push_overwrite.rs @@ -50,7 +50,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for PathBufPushOverwrite { if let Some(get_index_arg) = args.get(1); if let ExprKind::Lit(ref lit) = get_index_arg.kind; if let LitKind::Str(ref path_lit, _) = lit.node; - if let pushed_path = Path::new(&path_lit.as_str()); + if let pushed_path = Path::new(&*path_lit.as_str()); if let Some(pushed_path_lit) = pushed_path.to_str(); if pushed_path.has_root(); if let Some(root) = pushed_path.components().next(); diff --git a/clippy_lints/src/unsafe_removed_from_name.rs b/clippy_lints/src/unsafe_removed_from_name.rs index 528a1915be84..2f0e406b1a55 100644 --- a/clippy_lints/src/unsafe_removed_from_name.rs +++ b/clippy_lints/src/unsafe_removed_from_name.rs @@ -3,7 +3,7 @@ use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass}; use rustc::{declare_lint_pass, declare_tool_lint}; use syntax::ast::*; use syntax::source_map::Span; -use syntax::symbol::LocalInternedString; +use syntax::symbol::SymbolStr; declare_clippy_lint! { /// **What it does:** Checks for imports that remove "unsafe" from an item's @@ -73,6 +73,6 @@ fn unsafe_to_safe_check(old_name: Ident, new_name: Ident, cx: &EarlyContext<'_>, } #[must_use] -fn contains_unsafe(name: &LocalInternedString) -> bool { +fn contains_unsafe(name: &SymbolStr) -> bool { name.contains("Unsafe") || name.contains("unsafe") } diff --git a/clippy_lints/src/utils/internal_lints.rs b/clippy_lints/src/utils/internal_lints.rs index b5cd0d17f77d..1d1a3da6bc41 100644 --- a/clippy_lints/src/utils/internal_lints.rs +++ b/clippy_lints/src/utils/internal_lints.rs @@ -13,7 +13,7 @@ use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_errors::Applicability; use syntax::ast::{Crate as AstCrate, ItemKind, Name}; use syntax::source_map::Span; -use syntax_pos::symbol::LocalInternedString; +use syntax_pos::symbol::SymbolStr; declare_clippy_lint! { /// **What it does:** Checks for various things we like to keep tidy in clippy. @@ -112,7 +112,7 @@ impl EarlyLintPass for ClippyLintsInternal { if let ItemKind::Mod(ref utils_mod) = utils.kind { if let Some(paths) = utils_mod.items.iter().find(|item| item.ident.name.as_str() == "paths") { if let ItemKind::Mod(ref paths_mod) = paths.kind { - let mut last_name: Option = None; + let mut last_name: Option = None; for item in &*paths_mod.items { let name = item.ident.as_str(); if let Some(ref last_name) = last_name { @@ -279,8 +279,8 @@ declare_lint_pass!(OuterExpnDataPass => [OUTER_EXPN_EXPN_DATA]); impl<'a, 'tcx> LateLintPass<'a, 'tcx> for OuterExpnDataPass { fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx hir::Expr) { let (method_names, arg_lists, spans) = method_calls(expr, 2); - let method_names: Vec = method_names.iter().map(|s| s.as_str()).collect(); - let method_names: Vec<&str> = method_names.iter().map(std::convert::AsRef::as_ref).collect(); + let method_names: Vec = method_names.iter().map(|s| s.as_str()).collect(); + let method_names: Vec<&str> = method_names.iter().map(|s| &**s).collect(); if_chain! { if let ["expn_data", "outer_expn"] = method_names.as_slice(); let args = arg_lists[1]; From 56f3ba33c55f4651c7fdc54370b2f3601fbf7c4b Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Wed, 6 Nov 2019 16:46:32 +0700 Subject: [PATCH 4/5] chore: sort out clippy_lints deps --- clippy_lints/Cargo.toml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/clippy_lints/Cargo.toml b/clippy_lints/Cargo.toml index f7054a243756..9a77ee238eb7 100644 --- a/clippy_lints/Cargo.toml +++ b/clippy_lints/Cargo.toml @@ -18,20 +18,21 @@ edition = "2018" [dependencies] cargo_metadata = "0.9.0" +if_chain = "1.0.0" itertools = "0.8" lazy_static = "1.0.2" matches = "0.1.7" +pulldown-cmark = "0.6.0" quine-mc_cluskey = "0.2.2" regex-syntax = "0.6" -semver = "0.9.0" serde = { version = "1.0", features = ["derive"] } +smallvec = { version = "0.6.5", features = ["union"] } toml = "0.5.3" unicode-normalization = "0.1" -pulldown-cmark = "0.6.0" -url = { version = "2.1.0", features = ["serde"] } # cargo requires serde feat in its url dep -# see https://github.com/rust-lang/rust/pull/63587#issuecomment-522343864 -if_chain = "1.0.0" -smallvec = { version = "0.6.5", features = ["union"] } +semver = "0.9.0" +# NOTE: cargo requires serde feat in its url dep +# see +url = { version = "2.1.0", features = ["serde"] } [features] debugging = [] From 42c8c03464c5ca876d9fa1e31b6837a647bac5e0 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Wed, 6 Nov 2019 17:00:12 +0700 Subject: [PATCH 5/5] bump smallvec to 1.0.0 --- clippy_lints/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clippy_lints/Cargo.toml b/clippy_lints/Cargo.toml index 9a77ee238eb7..608fb668c5ae 100644 --- a/clippy_lints/Cargo.toml +++ b/clippy_lints/Cargo.toml @@ -26,7 +26,7 @@ pulldown-cmark = "0.6.0" quine-mc_cluskey = "0.2.2" regex-syntax = "0.6" serde = { version = "1.0", features = ["derive"] } -smallvec = { version = "0.6.5", features = ["union"] } +smallvec = { version = "1", features = ["union"] } toml = "0.5.3" unicode-normalization = "0.1" semver = "0.9.0"