]> git.lizzy.rs Git - rust.git/commitdiff
Fix rebase fallout
authorflip1995 <hello@philkrones.com>
Sun, 24 Feb 2019 16:54:53 +0000 (17:54 +0100)
committerflip1995 <hello@philkrones.com>
Wed, 3 Apr 2019 16:22:18 +0000 (18:22 +0200)
src/librustc/lint/internal.rs
src/test/ui-fulldeps/internal-lints/default_hash_types.rs
src/test/ui-fulldeps/internal-lints/default_hash_types.stderr
src/test/ui-fulldeps/internal-lints/ty_tykind_usage.rs
src/test/ui-fulldeps/internal-lints/ty_tykind_usage.stderr

index d4cf18123c3e3cb1610d0f4947dfd2ce7aa29836..22386b1c7a588dca2d3b07fcbc478e77bc83c0de 100644 (file)
@@ -1,21 +1,11 @@
-// Copyright 2012-2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
 //! Some lints that are only useful in the compiler or crates that use compiler internals, such as
 //! Clippy.
 
-use errors::Applicability;
-use hir::{Expr, ExprKind, PatKind, Path, QPath, Ty, TyKind};
-use lint::{
+use crate::hir::{Expr, ExprKind, PatKind, Path, QPath, Ty, TyKind};
+use crate::lint::{
     EarlyContext, EarlyLintPass, LateContext, LateLintPass, LintArray, LintContext, LintPass,
 };
+use errors::Applicability;
 use rustc_data_structures::fx::FxHashMap;
 use syntax::ast::Ident;
 
@@ -42,6 +32,10 @@ impl LintPass for DefaultHashTypes {
     fn get_lints(&self) -> LintArray {
         lint_array!(DEFAULT_HASH_TYPES)
     }
+
+    fn name(&self) -> &'static str {
+        "DefaultHashTypes"
+    }
 }
 
 impl EarlyLintPass for DefaultHashTypes {
@@ -53,7 +47,7 @@ fn check_ident(&mut self, cx: &EarlyContext<'_>, ident: Ident) {
                 replace, ident_string
             );
             let mut db = cx.struct_span_lint(DEFAULT_HASH_TYPES, ident.span, &msg);
-            db.span_suggestion_with_applicability(
+            db.span_suggestion(
                 ident.span,
                 "use",
                 replace.to_string(),
@@ -80,6 +74,10 @@ impl LintPass for TyKindUsage {
     fn get_lints(&self) -> LintArray {
         lint_array!(USAGE_OF_TY_TYKIND)
     }
+
+    fn name(&self) -> &'static str {
+        "TyKindUsage"
+    }
 }
 
 impl<'a, 'tcx> LateLintPass<'a, 'tcx> for TyKindUsage {
@@ -124,12 +122,13 @@ fn check_expr(&mut self, cx: &LateContext<'_, '_>, expr: &'tcx Expr) {
                                     path.span,
                                     "usage of `ty::TyKind::<kind>`",
                                 )
-                                .span_suggestion_with_applicability(
+                                .span_suggestion(
                                     path.span,
                                     "try using ty::<kind> directly",
                                     "ty".to_string(),
                                     Applicability::MaybeIncorrect, // ty maybe needs an import
-                                ).emit();
+                                )
+                                .emit();
                             }
                         }
                     }
index 6d32744145a8ae70280d65c2aa1454b2b2cc4f3d..a6b0dbafbeb9b3b04b3a00ff20e8cb64b03c2ef5 100644 (file)
@@ -1,13 +1,3 @@
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
 // compile-flags: -Z internal-lints
 
 #![feature(rustc_private)]
index 4f40c712aec4d6e86d30e20f0260bd04db545af4..323a3880d1cdcbdc5b53a5a85e70e87f283f2813 100644 (file)
@@ -1,5 +1,5 @@
 warning: Prefer FxHashMap over HashMap, it has better performance
-  --> $DIR/default_hash_types.rs:18:24
+  --> $DIR/default_hash_types.rs:8:24
    |
 LL | use std::collections::{HashMap, HashSet};
    |                        ^^^^^^^ help: use: `FxHashMap`
@@ -8,7 +8,7 @@ LL | use std::collections::{HashMap, HashSet};
    = note: a `use rustc_data_structures::fx::FxHashMap` may be necessary
 
 warning: Prefer FxHashSet over HashSet, it has better performance
-  --> $DIR/default_hash_types.rs:18:33
+  --> $DIR/default_hash_types.rs:8:33
    |
 LL | use std::collections::{HashMap, HashSet};
    |                                 ^^^^^^^ help: use: `FxHashSet`
@@ -16,20 +16,20 @@ LL | use std::collections::{HashMap, HashSet};
    = note: a `use rustc_data_structures::fx::FxHashSet` may be necessary
 
 error: Prefer FxHashMap over HashMap, it has better performance
-  --> $DIR/default_hash_types.rs:24:15
+  --> $DIR/default_hash_types.rs:14:15
    |
 LL |     let _map: HashMap<String, String> = HashMap::default();
    |               ^^^^^^^ help: use: `FxHashMap`
    |
 note: lint level defined here
-  --> $DIR/default_hash_types.rs:22:8
+  --> $DIR/default_hash_types.rs:12:8
    |
 LL | #[deny(default_hash_types)]
    |        ^^^^^^^^^^^^^^^^^^
    = note: a `use rustc_data_structures::fx::FxHashMap` may be necessary
 
 error: Prefer FxHashMap over HashMap, it has better performance
-  --> $DIR/default_hash_types.rs:24:41
+  --> $DIR/default_hash_types.rs:14:41
    |
 LL |     let _map: HashMap<String, String> = HashMap::default();
    |                                         ^^^^^^^ help: use: `FxHashMap`
@@ -37,7 +37,7 @@ LL |     let _map: HashMap<String, String> = HashMap::default();
    = note: a `use rustc_data_structures::fx::FxHashMap` may be necessary
 
 error: Prefer FxHashSet over HashSet, it has better performance
-  --> $DIR/default_hash_types.rs:27:15
+  --> $DIR/default_hash_types.rs:17:15
    |
 LL |     let _set: HashSet<String> = HashSet::default();
    |               ^^^^^^^ help: use: `FxHashSet`
@@ -45,7 +45,7 @@ LL |     let _set: HashSet<String> = HashSet::default();
    = note: a `use rustc_data_structures::fx::FxHashSet` may be necessary
 
 error: Prefer FxHashSet over HashSet, it has better performance
-  --> $DIR/default_hash_types.rs:27:33
+  --> $DIR/default_hash_types.rs:17:33
    |
 LL |     let _set: HashSet<String> = HashSet::default();
    |                                 ^^^^^^^ help: use: `FxHashSet`
index 9962d9c6bcbbba1f0b40d9bd892228d926b7c91b..a1e08cd3b95bc96fc0214ecdff4bb0a582ae247e 100644 (file)
@@ -1,13 +1,3 @@
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
 // compile-flags: -Z internal-lints
 
 #![feature(rustc_private)]
index 82a8c715560e813f0f209c075dd5f55dec8464cc..d3ad5e1264a4d43e278092fd574ee734bb294fa1 100644 (file)
 error: usage of `ty::TyKind::<kind>`
-  --> $DIR/ty_tykind_usage.rs:21:15
+  --> $DIR/ty_tykind_usage.rs:11:15
    |
 LL |     let sty = TyKind::Bool; //~ ERROR usage of `ty::TyKind::<kind>`
    |               ^^^^^^ help: try using ty::<kind> directly: `ty`
    |
 note: lint level defined here
-  --> $DIR/ty_tykind_usage.rs:19:8
+  --> $DIR/ty_tykind_usage.rs:9:8
    |
 LL | #[deny(usage_of_ty_tykind)]
    |        ^^^^^^^^^^^^^^^^^^
 
 error: usage of `ty::TyKind::<kind>`
-  --> $DIR/ty_tykind_usage.rs:24:9
+  --> $DIR/ty_tykind_usage.rs:14:9
    |
 LL |         TyKind::Bool => (), //~ ERROR usage of `ty::TyKind::<kind>`
    |         ^^^^^^ help: try using ty::<kind> directly: `ty`
 
 error: usage of `ty::TyKind::<kind>`
-  --> $DIR/ty_tykind_usage.rs:25:9
+  --> $DIR/ty_tykind_usage.rs:15:9
    |
 LL |         TyKind::Char => (), //~ ERROR usage of `ty::TyKind::<kind>`
    |         ^^^^^^ help: try using ty::<kind> directly: `ty`
 
 error: usage of `ty::TyKind::<kind>`
-  --> $DIR/ty_tykind_usage.rs:26:9
+  --> $DIR/ty_tykind_usage.rs:16:9
    |
 LL |         TyKind::Int(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
    |         ^^^^^^ help: try using ty::<kind> directly: `ty`
 
 error: usage of `ty::TyKind::<kind>`
-  --> $DIR/ty_tykind_usage.rs:27:9
+  --> $DIR/ty_tykind_usage.rs:17:9
    |
 LL |         TyKind::Uint(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
    |         ^^^^^^ help: try using ty::<kind> directly: `ty`
 
 error: usage of `ty::TyKind::<kind>`
-  --> $DIR/ty_tykind_usage.rs:28:9
+  --> $DIR/ty_tykind_usage.rs:18:9
    |
 LL |         TyKind::Float(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
    |         ^^^^^^ help: try using ty::<kind> directly: `ty`
 
 error: usage of `ty::TyKind::<kind>`
-  --> $DIR/ty_tykind_usage.rs:29:9
+  --> $DIR/ty_tykind_usage.rs:19:9
    |
 LL |         TyKind::Adt(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
    |         ^^^^^^ help: try using ty::<kind> directly: `ty`
 
 error: usage of `ty::TyKind::<kind>`
-  --> $DIR/ty_tykind_usage.rs:30:9
+  --> $DIR/ty_tykind_usage.rs:20:9
    |
 LL |         TyKind::Foreign(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
    |         ^^^^^^ help: try using ty::<kind> directly: `ty`
 
 error: usage of `ty::TyKind::<kind>`
-  --> $DIR/ty_tykind_usage.rs:31:9
+  --> $DIR/ty_tykind_usage.rs:21:9
    |
 LL |         TyKind::Str => (), //~ ERROR usage of `ty::TyKind::<kind>`
    |         ^^^^^^ help: try using ty::<kind> directly: `ty`
 
 error: usage of `ty::TyKind::<kind>`
-  --> $DIR/ty_tykind_usage.rs:32:9
+  --> $DIR/ty_tykind_usage.rs:22:9
    |
 LL |         TyKind::Array(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
    |         ^^^^^^ help: try using ty::<kind> directly: `ty`
 
 error: usage of `ty::TyKind::<kind>`
-  --> $DIR/ty_tykind_usage.rs:33:9
+  --> $DIR/ty_tykind_usage.rs:23:9
    |
 LL |         TyKind::Slice(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
    |         ^^^^^^ help: try using ty::<kind> directly: `ty`
 
 error: usage of `ty::TyKind::<kind>`
-  --> $DIR/ty_tykind_usage.rs:34:9
+  --> $DIR/ty_tykind_usage.rs:24:9
    |
 LL |         TyKind::RawPtr(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
    |         ^^^^^^ help: try using ty::<kind> directly: `ty`
 
 error: usage of `ty::TyKind::<kind>`
-  --> $DIR/ty_tykind_usage.rs:35:9
+  --> $DIR/ty_tykind_usage.rs:25:9
    |
 LL |         TyKind::Ref(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
    |         ^^^^^^ help: try using ty::<kind> directly: `ty`
 
 error: usage of `ty::TyKind::<kind>`
-  --> $DIR/ty_tykind_usage.rs:36:9
+  --> $DIR/ty_tykind_usage.rs:26:9
    |
 LL |         TyKind::FnDef(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
    |         ^^^^^^ help: try using ty::<kind> directly: `ty`
 
 error: usage of `ty::TyKind::<kind>`
-  --> $DIR/ty_tykind_usage.rs:37:9
+  --> $DIR/ty_tykind_usage.rs:27:9
    |
 LL |         TyKind::FnPtr(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
    |         ^^^^^^ help: try using ty::<kind> directly: `ty`
 
 error: usage of `ty::TyKind::<kind>`
-  --> $DIR/ty_tykind_usage.rs:38:9
+  --> $DIR/ty_tykind_usage.rs:28:9
    |
 LL |         TyKind::Dynamic(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
    |         ^^^^^^ help: try using ty::<kind> directly: `ty`
 
 error: usage of `ty::TyKind::<kind>`
-  --> $DIR/ty_tykind_usage.rs:39:9
+  --> $DIR/ty_tykind_usage.rs:29:9
    |
 LL |         TyKind::Closure(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
    |         ^^^^^^ help: try using ty::<kind> directly: `ty`
 
 error: usage of `ty::TyKind::<kind>`
-  --> $DIR/ty_tykind_usage.rs:40:9
+  --> $DIR/ty_tykind_usage.rs:30:9
    |
 LL |         TyKind::Generator(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
    |         ^^^^^^ help: try using ty::<kind> directly: `ty`
 
 error: usage of `ty::TyKind::<kind>`
-  --> $DIR/ty_tykind_usage.rs:41:9
+  --> $DIR/ty_tykind_usage.rs:31:9
    |
 LL |         TyKind::GeneratorWitness(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
    |         ^^^^^^ help: try using ty::<kind> directly: `ty`
 
 error: usage of `ty::TyKind::<kind>`
-  --> $DIR/ty_tykind_usage.rs:42:9
+  --> $DIR/ty_tykind_usage.rs:32:9
    |
 LL |         TyKind::Never => (), //~ ERROR usage of `ty::TyKind::<kind>`
    |         ^^^^^^ help: try using ty::<kind> directly: `ty`
 
 error: usage of `ty::TyKind::<kind>`
-  --> $DIR/ty_tykind_usage.rs:43:9
+  --> $DIR/ty_tykind_usage.rs:33:9
    |
 LL |         TyKind::Tuple(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
    |         ^^^^^^ help: try using ty::<kind> directly: `ty`
 
 error: usage of `ty::TyKind::<kind>`
-  --> $DIR/ty_tykind_usage.rs:44:9
+  --> $DIR/ty_tykind_usage.rs:34:9
    |
 LL |         TyKind::Projection(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
    |         ^^^^^^ help: try using ty::<kind> directly: `ty`
 
 error: usage of `ty::TyKind::<kind>`
-  --> $DIR/ty_tykind_usage.rs:45:9
+  --> $DIR/ty_tykind_usage.rs:35:9
    |
 LL |         TyKind::UnnormalizedProjection(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
    |         ^^^^^^ help: try using ty::<kind> directly: `ty`
 
 error: usage of `ty::TyKind::<kind>`
-  --> $DIR/ty_tykind_usage.rs:46:9
+  --> $DIR/ty_tykind_usage.rs:36:9
    |
 LL |         TyKind::Opaque(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
    |         ^^^^^^ help: try using ty::<kind> directly: `ty`
 
 error: usage of `ty::TyKind::<kind>`
-  --> $DIR/ty_tykind_usage.rs:47:9
+  --> $DIR/ty_tykind_usage.rs:37:9
    |
 LL |         TyKind::Param(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
    |         ^^^^^^ help: try using ty::<kind> directly: `ty`
 
 error: usage of `ty::TyKind::<kind>`
-  --> $DIR/ty_tykind_usage.rs:48:9
+  --> $DIR/ty_tykind_usage.rs:38:9
    |
 LL |         TyKind::Bound(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
    |         ^^^^^^ help: try using ty::<kind> directly: `ty`
 
 error: usage of `ty::TyKind::<kind>`
-  --> $DIR/ty_tykind_usage.rs:49:9
+  --> $DIR/ty_tykind_usage.rs:39:9
    |
 LL |         TyKind::Placeholder(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
    |         ^^^^^^ help: try using ty::<kind> directly: `ty`
 
 error: usage of `ty::TyKind::<kind>`
-  --> $DIR/ty_tykind_usage.rs:50:9
+  --> $DIR/ty_tykind_usage.rs:40:9
    |
 LL |         TyKind::Infer(..) => (), //~ ERROR usage of `ty::TyKind::<kind>`
    |         ^^^^^^ help: try using ty::<kind> directly: `ty`
 
 error: usage of `ty::TyKind::<kind>`
-  --> $DIR/ty_tykind_usage.rs:51:9
+  --> $DIR/ty_tykind_usage.rs:41:9
    |
 LL |         TyKind::Error => (), //~ ERROR usage of `ty::TyKind::<kind>`
    |         ^^^^^^ help: try using ty::<kind> directly: `ty`
 
 error: usage of `ty::TyKind::<kind>`
-  --> $DIR/ty_tykind_usage.rs:56:12
+  --> $DIR/ty_tykind_usage.rs:46:12
    |
 LL |     if let TyKind::Int(int_ty) = sty {} //~ ERROR usage of `ty::TyKind::<kind>`
    |            ^^^^^^ help: try using ty::<kind> directly: `ty`
 
 error: usage of `ty::TyKind`
-  --> $DIR/ty_tykind_usage.rs:58:24
+  --> $DIR/ty_tykind_usage.rs:48:24
    |
 LL |     fn ty_kind(ty_bad: TyKind<'_>, ty_good: Ty<'_>) {} //~ ERROR usage of `ty::TyKind`
    |                        ^^^^^^^^^^