Skip to content

Commit

Permalink
Auto merge of rust-lang#95524 - oli-obk:cached_stable_hash_cleanups, …
Browse files Browse the repository at this point in the history
…r=nnethercote

Cached stable hash cleanups

r? `@nnethercote`

Add a sanity assertion in debug mode to check that the cached hashes are actually the ones we get if we compute the hash each time.

Add a new data structure that bundles all the hash-caching work to make it easier to re-use it for different interned data structures
  • Loading branch information
bors committed Apr 9, 2022
2 parents da26623 + b79f13e commit 0155a63
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions clippy_lints/src/case_sensitive_file_extension_comparisons.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use clippy_utils::diagnostics::span_lint_and_help;
use if_chain::if_chain;
use rustc_ast::ast::LitKind;
use rustc_data_structures::intern::Interned;
use rustc_hir::{Expr, ExprKind, PathSegment};
use rustc_lint::{LateContext, LateLintPass};
use rustc_middle::ty;
Expand Down Expand Up @@ -56,8 +55,8 @@ fn check_case_sensitive_file_extension_comparison(ctx: &LateContext<'_>, expr: &
ty::Str => {
return Some(span);
},
ty::Adt(ty::AdtDef(Interned(&ty::AdtDefData { did, .. }, _)), _) => {
if ctx.tcx.is_diagnostic_item(sym::String, did) {
ty::Adt(def, _) => {
if ctx.tcx.is_diagnostic_item(sym::String, def.did()) {
return Some(span);
}
},
Expand Down

0 comments on commit 0155a63

Please sign in to comment.