]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/check/expr.rs
Rollup merge of #75485 - RalfJung:pin, r=nagisa
[rust.git] / src / librustc_typeck / check / expr.rs
index 63c100d5fad4f17bd399cdea8c571f6459621275..e88f13a1f3ab68576acd1f10a5cd42dadfecbd93 100644 (file)
@@ -19,6 +19,7 @@
 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;
@@ -177,7 +178,7 @@ pub(super) fn check_expr_with_expectation(
         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 {
@@ -1605,7 +1606,7 @@ fn point_at_param_definition(&self, err: &mut DiagnosticBuilder<'_>, param: ty::
         }
         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);