//! - or-fun-call
//! - option-if-let-else
-use crate::{is_ctor_or_promotable_const_function, is_type_diagnostic_item, match_type, paths};
+use crate::is_ctor_or_promotable_const_function;
+use crate::ty::is_type_diagnostic_item;
use rustc_hir::def::{DefKind, Res};
use rustc_hir::intravisit;
use rustc_hir::{Block, Expr, ExprKind, Path, QPath};
use rustc_lint::LateContext;
use rustc_middle::hir::map::Map;
+use rustc_span::sym;
/// Is the expr pure (is it free from side-effects)?
/// This function is named so to stress that it isn't exhaustive and returns FNs.
ExprKind::Call(..) => !is_ctor_or_promotable_const_function(self.cx, expr),
ExprKind::Index(obj, _) => {
let ty = self.cx.typeck_results().expr_ty(obj);
- is_type_diagnostic_item(self.cx, ty, sym!(hashmap_type))
- || match_type(self.cx, ty, &paths::BTREEMAP)
+ is_type_diagnostic_item(self.cx, ty, sym::hashmap_type)
+ || is_type_diagnostic_item(self.cx, ty, sym::BTreeMap)
},
ExprKind::MethodCall(..) => true,
_ => false,