declare_lint_pass!(MemDiscriminant => [MEM_DISCRIMINANT_NON_ENUM]);
-impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MemDiscriminant {
- fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr<'_>) {
+impl<'tcx> LateLintPass<'tcx> for MemDiscriminant {
+ fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
if_chain! {
if let ExprKind::Call(ref func, ref func_args) = expr.kind;
// is `mem::discriminant`
if let ExprKind::Path(ref func_qpath) = func.kind;
- if let Some(def_id) = cx.tables.qpath_res(func_qpath, func.hir_id).opt_def_id();
+ if let Some(def_id) = cx.qpath_res(func_qpath, func.hir_id).opt_def_id();
if match_def_path(cx, def_id, &paths::MEM_DISCRIMINANT);
// type is non-enum
- let ty_param = cx.tables.node_substs(func.hir_id).type_at(0);
+ let ty_param = cx.typeck_results().node_substs(func.hir_id).type_at(0);
if !ty_param.is_enum();
then {