use rustc_ast::ast;
use rustc_ast::util::lev_distance::find_best_match_for_name;
use rustc_data_structures::fx::FxHashMap;
+use rustc_data_structures::stack::ensure_sufficient_stack;
use rustc_errors::ErrorReported;
use rustc_errors::{pluralize, struct_span_err, Applicability, DiagnosticBuilder, DiagnosticId};
use rustc_hir as hir;
let old_diverges = self.diverges.replace(Diverges::Maybe);
let old_has_errors = self.has_errors.replace(false);
- let ty = self.check_expr_kind(expr, expected);
+ let ty = ensure_sufficient_stack(|| self.check_expr_kind(expr, expected));
// Warn for non-block expressions with diverging children.
match expr.kind {
}
let param_def_id = generic_param.def_id;
let param_hir_id = match param_def_id.as_local() {
- Some(x) => self.tcx.hir().as_local_hir_id(x),
+ Some(x) => self.tcx.hir().local_def_id_to_hir_id(x),
None => return,
};
let param_span = self.tcx.hir().span(param_hir_id);