fn check_stmt(&mut self, cx: &LateContext<'tcx>, stmt: &'tcx Stmt<'_>) {
if let StmtKind::Local(ref local) = stmt.kind {
if let Some(init) = &local.init {
- if let Some(init_ty) = cx.tables().node_type_opt(init.hir_id) {
+ if let Some(init_ty) = cx.typeck_results().node_type_opt(init.hir_id) {
let pat = &local.pat;
if in_external_macro(cx.sess(), pat.span) {
return;
if let ExprKind::Match(ref expr, arms, source) = expr.kind {
match source {
MatchSource::Normal | MatchSource::IfLetDesugar { .. } | MatchSource::WhileLetDesugar => {
- if let Some(expr_ty) = cx.tables().node_type_opt(expr.hir_id) {
+ if let Some(expr_ty) = cx.typeck_results().node_type_opt(expr.hir_id) {
'pattern_checks: for arm in arms {
let pat = &arm.pat;
if in_external_macro(cx.sess(), pat.span) {
_: Span,
hir_id: HirId,
) {
- if let Some(fn_sig) = cx.tables().liberated_fn_sigs().get(hir_id) {
+ if let Some(fn_sig) = cx.typeck_results().liberated_fn_sigs().get(hir_id) {
for (param, ty) in body.params.iter().zip(fn_sig.inputs().iter()) {
apply_lint(cx, ¶m.pat, ty, DerefPossible::Impossible);
}
level: Level,
) -> Option<(Span, Mutability, Level)> {
if let PatKind::Ref(ref sub_pat, _) = pat.kind {
- if let TyKind::Ref(_, sub_ty, _) = ty.kind {
+ if let TyKind::Ref(_, sub_ty, _) = ty.kind() {
return find_first_mismatch(cx, sub_pat, sub_ty, Level::Lower);
}
}
- if let TyKind::Ref(_, _, mutability) = ty.kind {
+ if let TyKind::Ref(_, _, mutability) = *ty.kind() {
if is_non_ref_pattern(&pat.kind) {
return Some((pat.span, mutability, level));
}
}
if let PatKind::Struct(ref qpath, ref field_pats, _) = pat.kind {
- if let TyKind::Adt(ref adt_def, ref substs_ref) = ty.kind {
+ if let TyKind::Adt(ref adt_def, ref substs_ref) = ty.kind() {
if let Some(variant) = get_variant(adt_def, qpath) {
let field_defs = &variant.fields;
return find_first_mismatch_in_struct(cx, field_pats, field_defs, substs_ref);
}
if let PatKind::TupleStruct(ref qpath, ref pats, _) = pat.kind {
- if let TyKind::Adt(ref adt_def, ref substs_ref) = ty.kind {
+ if let TyKind::Adt(ref adt_def, ref substs_ref) = ty.kind() {
if let Some(variant) = get_variant(adt_def, qpath) {
let field_defs = &variant.fields;
let ty_iter = field_defs.iter().map(|field_def| field_def.ty(cx.tcx, substs_ref));
}
if let PatKind::Tuple(ref pats, _) = pat.kind {
- if let TyKind::Tuple(..) = ty.kind {
+ if let TyKind::Tuple(..) = ty.kind() {
return find_first_mismatch_in_tuple(cx, pats, ty.tuple_fields());
}
}