From 2045dfed248d179c94d58eed7ca2922010b0fffc Mon Sep 17 00:00:00 2001 From: flip1995 Date: Thu, 21 Mar 2019 17:10:25 +0100 Subject: [PATCH] Update tests --- .../internal-lints/default_hash_types.rs | 4 +- .../internal-lints/default_hash_types.stderr | 27 ++------ .../internal-lints/ty_tykind_usage.rs | 2 +- .../internal-lints/ty_tykind_usage.stderr | 62 +++++++++---------- 4 files changed, 38 insertions(+), 57 deletions(-) diff --git a/src/test/ui-fulldeps/internal-lints/default_hash_types.rs b/src/test/ui-fulldeps/internal-lints/default_hash_types.rs index a6b0dbafbeb9..3264099c876d 100644 --- a/src/test/ui-fulldeps/internal-lints/default_hash_types.rs +++ b/src/test/ui-fulldeps/internal-lints/default_hash_types.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z internal-lints +// compile-flags: -Z unstable-options #![feature(rustc_private)] @@ -6,8 +6,6 @@ extern crate rustc_data_structures; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use std::collections::{HashMap, HashSet}; -//~^ WARNING Prefer FxHashMap over HashMap, it has better performance -//~^^ WARNING Prefer FxHashSet over HashSet, it has better performance #[deny(default_hash_types)] fn main() { diff --git a/src/test/ui-fulldeps/internal-lints/default_hash_types.stderr b/src/test/ui-fulldeps/internal-lints/default_hash_types.stderr index 323a3880d1cd..64f322cb0c16 100644 --- a/src/test/ui-fulldeps/internal-lints/default_hash_types.stderr +++ b/src/test/ui-fulldeps/internal-lints/default_hash_types.stderr @@ -1,35 +1,18 @@ -warning: Prefer FxHashMap over HashMap, it has better performance - --> $DIR/default_hash_types.rs:8:24 - | -LL | use std::collections::{HashMap, HashSet}; - | ^^^^^^^ help: use: `FxHashMap` - | - = note: #[warn(default_hash_types)] on by default - = 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:8:33 - | -LL | use std::collections::{HashMap, HashSet}; - | ^^^^^^^ help: use: `FxHashSet` - | - = 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:14:15 + --> $DIR/default_hash_types.rs:12:15 | LL | let _map: HashMap = HashMap::default(); | ^^^^^^^ help: use: `FxHashMap` | note: lint level defined here - --> $DIR/default_hash_types.rs:12:8 + --> $DIR/default_hash_types.rs:10: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:14:41 + --> $DIR/default_hash_types.rs:12:41 | LL | let _map: HashMap = HashMap::default(); | ^^^^^^^ help: use: `FxHashMap` @@ -37,7 +20,7 @@ LL | let _map: HashMap = 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:17:15 + --> $DIR/default_hash_types.rs:15:15 | LL | let _set: HashSet = HashSet::default(); | ^^^^^^^ help: use: `FxHashSet` @@ -45,7 +28,7 @@ LL | let _set: HashSet = 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:17:33 + --> $DIR/default_hash_types.rs:15:33 | LL | let _set: HashSet = HashSet::default(); | ^^^^^^^ help: use: `FxHashSet` diff --git a/src/test/ui-fulldeps/internal-lints/ty_tykind_usage.rs b/src/test/ui-fulldeps/internal-lints/ty_tykind_usage.rs index a1e08cd3b95b..dba0db69b7f3 100644 --- a/src/test/ui-fulldeps/internal-lints/ty_tykind_usage.rs +++ b/src/test/ui-fulldeps/internal-lints/ty_tykind_usage.rs @@ -1,4 +1,4 @@ -// compile-flags: -Z internal-lints +// compile-flags: -Z unstable-options #![feature(rustc_private)] diff --git a/src/test/ui-fulldeps/internal-lints/ty_tykind_usage.stderr b/src/test/ui-fulldeps/internal-lints/ty_tykind_usage.stderr index d3ad5e1264a4..4e94af12453c 100644 --- a/src/test/ui-fulldeps/internal-lints/ty_tykind_usage.stderr +++ b/src/test/ui-fulldeps/internal-lints/ty_tykind_usage.stderr @@ -1,7 +1,7 @@ error: usage of `ty::TyKind::` --> $DIR/ty_tykind_usage.rs:11:15 | -LL | let sty = TyKind::Bool; //~ ERROR usage of `ty::TyKind::` +LL | let sty = TyKind::Bool; | ^^^^^^ help: try using ty:: directly: `ty` | note: lint level defined here @@ -13,181 +13,181 @@ LL | #[deny(usage_of_ty_tykind)] error: usage of `ty::TyKind::` --> $DIR/ty_tykind_usage.rs:14:9 | -LL | TyKind::Bool => (), //~ ERROR usage of `ty::TyKind::` +LL | TyKind::Bool => (), | ^^^^^^ help: try using ty:: directly: `ty` error: usage of `ty::TyKind::` --> $DIR/ty_tykind_usage.rs:15:9 | -LL | TyKind::Char => (), //~ ERROR usage of `ty::TyKind::` +LL | TyKind::Char => (), | ^^^^^^ help: try using ty:: directly: `ty` error: usage of `ty::TyKind::` --> $DIR/ty_tykind_usage.rs:16:9 | -LL | TyKind::Int(..) => (), //~ ERROR usage of `ty::TyKind::` +LL | TyKind::Int(..) => (), | ^^^^^^ help: try using ty:: directly: `ty` error: usage of `ty::TyKind::` --> $DIR/ty_tykind_usage.rs:17:9 | -LL | TyKind::Uint(..) => (), //~ ERROR usage of `ty::TyKind::` +LL | TyKind::Uint(..) => (), | ^^^^^^ help: try using ty:: directly: `ty` error: usage of `ty::TyKind::` --> $DIR/ty_tykind_usage.rs:18:9 | -LL | TyKind::Float(..) => (), //~ ERROR usage of `ty::TyKind::` +LL | TyKind::Float(..) => (), | ^^^^^^ help: try using ty:: directly: `ty` error: usage of `ty::TyKind::` --> $DIR/ty_tykind_usage.rs:19:9 | -LL | TyKind::Adt(..) => (), //~ ERROR usage of `ty::TyKind::` +LL | TyKind::Adt(..) => (), | ^^^^^^ help: try using ty:: directly: `ty` error: usage of `ty::TyKind::` --> $DIR/ty_tykind_usage.rs:20:9 | -LL | TyKind::Foreign(..) => (), //~ ERROR usage of `ty::TyKind::` +LL | TyKind::Foreign(..) => (), | ^^^^^^ help: try using ty:: directly: `ty` error: usage of `ty::TyKind::` --> $DIR/ty_tykind_usage.rs:21:9 | -LL | TyKind::Str => (), //~ ERROR usage of `ty::TyKind::` +LL | TyKind::Str => (), | ^^^^^^ help: try using ty:: directly: `ty` error: usage of `ty::TyKind::` --> $DIR/ty_tykind_usage.rs:22:9 | -LL | TyKind::Array(..) => (), //~ ERROR usage of `ty::TyKind::` +LL | TyKind::Array(..) => (), | ^^^^^^ help: try using ty:: directly: `ty` error: usage of `ty::TyKind::` --> $DIR/ty_tykind_usage.rs:23:9 | -LL | TyKind::Slice(..) => (), //~ ERROR usage of `ty::TyKind::` +LL | TyKind::Slice(..) => (), | ^^^^^^ help: try using ty:: directly: `ty` error: usage of `ty::TyKind::` --> $DIR/ty_tykind_usage.rs:24:9 | -LL | TyKind::RawPtr(..) => (), //~ ERROR usage of `ty::TyKind::` +LL | TyKind::RawPtr(..) => (), | ^^^^^^ help: try using ty:: directly: `ty` error: usage of `ty::TyKind::` --> $DIR/ty_tykind_usage.rs:25:9 | -LL | TyKind::Ref(..) => (), //~ ERROR usage of `ty::TyKind::` +LL | TyKind::Ref(..) => (), | ^^^^^^ help: try using ty:: directly: `ty` error: usage of `ty::TyKind::` --> $DIR/ty_tykind_usage.rs:26:9 | -LL | TyKind::FnDef(..) => (), //~ ERROR usage of `ty::TyKind::` +LL | TyKind::FnDef(..) => (), | ^^^^^^ help: try using ty:: directly: `ty` error: usage of `ty::TyKind::` --> $DIR/ty_tykind_usage.rs:27:9 | -LL | TyKind::FnPtr(..) => (), //~ ERROR usage of `ty::TyKind::` +LL | TyKind::FnPtr(..) => (), | ^^^^^^ help: try using ty:: directly: `ty` error: usage of `ty::TyKind::` --> $DIR/ty_tykind_usage.rs:28:9 | -LL | TyKind::Dynamic(..) => (), //~ ERROR usage of `ty::TyKind::` +LL | TyKind::Dynamic(..) => (), | ^^^^^^ help: try using ty:: directly: `ty` error: usage of `ty::TyKind::` --> $DIR/ty_tykind_usage.rs:29:9 | -LL | TyKind::Closure(..) => (), //~ ERROR usage of `ty::TyKind::` +LL | TyKind::Closure(..) => (), | ^^^^^^ help: try using ty:: directly: `ty` error: usage of `ty::TyKind::` --> $DIR/ty_tykind_usage.rs:30:9 | -LL | TyKind::Generator(..) => (), //~ ERROR usage of `ty::TyKind::` +LL | TyKind::Generator(..) => (), | ^^^^^^ help: try using ty:: directly: `ty` error: usage of `ty::TyKind::` --> $DIR/ty_tykind_usage.rs:31:9 | -LL | TyKind::GeneratorWitness(..) => (), //~ ERROR usage of `ty::TyKind::` +LL | TyKind::GeneratorWitness(..) => (), | ^^^^^^ help: try using ty:: directly: `ty` error: usage of `ty::TyKind::` --> $DIR/ty_tykind_usage.rs:32:9 | -LL | TyKind::Never => (), //~ ERROR usage of `ty::TyKind::` +LL | TyKind::Never => (), | ^^^^^^ help: try using ty:: directly: `ty` error: usage of `ty::TyKind::` --> $DIR/ty_tykind_usage.rs:33:9 | -LL | TyKind::Tuple(..) => (), //~ ERROR usage of `ty::TyKind::` +LL | TyKind::Tuple(..) => (), | ^^^^^^ help: try using ty:: directly: `ty` error: usage of `ty::TyKind::` --> $DIR/ty_tykind_usage.rs:34:9 | -LL | TyKind::Projection(..) => (), //~ ERROR usage of `ty::TyKind::` +LL | TyKind::Projection(..) => (), | ^^^^^^ help: try using ty:: directly: `ty` error: usage of `ty::TyKind::` --> $DIR/ty_tykind_usage.rs:35:9 | -LL | TyKind::UnnormalizedProjection(..) => (), //~ ERROR usage of `ty::TyKind::` +LL | TyKind::UnnormalizedProjection(..) => (), | ^^^^^^ help: try using ty:: directly: `ty` error: usage of `ty::TyKind::` --> $DIR/ty_tykind_usage.rs:36:9 | -LL | TyKind::Opaque(..) => (), //~ ERROR usage of `ty::TyKind::` +LL | TyKind::Opaque(..) => (), | ^^^^^^ help: try using ty:: directly: `ty` error: usage of `ty::TyKind::` --> $DIR/ty_tykind_usage.rs:37:9 | -LL | TyKind::Param(..) => (), //~ ERROR usage of `ty::TyKind::` +LL | TyKind::Param(..) => (), | ^^^^^^ help: try using ty:: directly: `ty` error: usage of `ty::TyKind::` --> $DIR/ty_tykind_usage.rs:38:9 | -LL | TyKind::Bound(..) => (), //~ ERROR usage of `ty::TyKind::` +LL | TyKind::Bound(..) => (), | ^^^^^^ help: try using ty:: directly: `ty` error: usage of `ty::TyKind::` --> $DIR/ty_tykind_usage.rs:39:9 | -LL | TyKind::Placeholder(..) => (), //~ ERROR usage of `ty::TyKind::` +LL | TyKind::Placeholder(..) => (), | ^^^^^^ help: try using ty:: directly: `ty` error: usage of `ty::TyKind::` --> $DIR/ty_tykind_usage.rs:40:9 | -LL | TyKind::Infer(..) => (), //~ ERROR usage of `ty::TyKind::` +LL | TyKind::Infer(..) => (), | ^^^^^^ help: try using ty:: directly: `ty` error: usage of `ty::TyKind::` --> $DIR/ty_tykind_usage.rs:41:9 | -LL | TyKind::Error => (), //~ ERROR usage of `ty::TyKind::` +LL | TyKind::Error => (), | ^^^^^^ help: try using ty:: directly: `ty` error: usage of `ty::TyKind::` --> $DIR/ty_tykind_usage.rs:46:12 | -LL | if let TyKind::Int(int_ty) = sty {} //~ ERROR usage of `ty::TyKind::` +LL | if let TyKind::Int(int_ty) = sty {} | ^^^^^^ help: try using ty:: directly: `ty` error: usage of `ty::TyKind` --> $DIR/ty_tykind_usage.rs:48:24 | -LL | fn ty_kind(ty_bad: TyKind<'_>, ty_good: Ty<'_>) {} //~ ERROR usage of `ty::TyKind` +LL | fn ty_kind(ty_bad: TyKind<'_>, ty_good: Ty<'_>) {} | ^^^^^^^^^^ | = help: try using `ty::Ty` instead