Skip to content

Commit 9586ddb

Browse files
committed
Fix fallout from not ignoring warnings anymore
1 parent ff452d5 commit 9586ddb

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

clippy_utils/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ extern crate rustc_attr;
2020
extern crate rustc_data_structures;
2121
extern crate rustc_errors;
2222
extern crate rustc_hir;
23-
extern crate rustc_hir_pretty;
2423
extern crate rustc_infer;
2524
extern crate rustc_lexer;
2625
extern crate rustc_lint;
@@ -1333,7 +1332,7 @@ pub fn if_sequence<'tcx>(mut expr: &'tcx Expr<'tcx>) -> (Vec<&'tcx Expr<'tcx>>,
13331332
}
13341333

13351334
/// Checks if the given function kind is an async function.
1336-
pub fn is_async_fn(kind: FnKind) -> bool {
1335+
pub fn is_async_fn(kind: FnKind<'_>) -> bool {
13371336
matches!(kind, FnKind::ItemFn(_, _, header, _) if header.asyncness == IsAsync::Async)
13381337
}
13391338

clippy_utils/src/ty.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
33
#![allow(clippy::module_name_repetitions)]
44

5-
use std::collections::HashMap;
6-
75
use rustc_ast::ast::Mutability;
6+
use rustc_data_structures::fx::FxHashMap;
87
use rustc_hir as hir;
98
use rustc_hir::def_id::DefId;
109
use rustc_hir::{TyKind, Unsafety};
@@ -184,14 +183,14 @@ pub fn is_must_use_ty<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> bool {
184183
/// Checks if `Ty` is normalizable. This function is useful
185184
/// to avoid crashes on `layout_of`.
186185
pub fn is_normalizable<'tcx>(cx: &LateContext<'tcx>, param_env: ty::ParamEnv<'tcx>, ty: Ty<'tcx>) -> bool {
187-
is_normalizable_helper(cx, param_env, ty, &mut HashMap::new())
186+
is_normalizable_helper(cx, param_env, ty, &mut FxHashMap::default())
188187
}
189188

190189
fn is_normalizable_helper<'tcx>(
191190
cx: &LateContext<'tcx>,
192191
param_env: ty::ParamEnv<'tcx>,
193192
ty: Ty<'tcx>,
194-
cache: &mut HashMap<Ty<'tcx>, bool>,
193+
cache: &mut FxHashMap<Ty<'tcx>, bool>,
195194
) -> bool {
196195
if let Some(&cached_result) = cache.get(ty) {
197196
return cached_result;

0 commit comments

Comments
 (0)