]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_lint/src/early.rs
Rollup merge of #107499 - compiler-errors:deduce_sig_from_projection-generator-tweak...
[rust.git] / compiler / rustc_lint / src / early.rs
index 769c2f88ff3da94a3e0e485ff003dc74d3415c6e..337a19dd024d2fec195601c77de253036df847bf 100644 (file)
@@ -19,6 +19,7 @@
 use rustc_ast::ptr::P;
 use rustc_ast::visit::{self as ast_visit, Visitor};
 use rustc_ast::{self as ast, walk_list, HasAttrs};
+use rustc_data_structures::stack::ensure_sufficient_stack;
 use rustc_middle::ty::RegisteredTools;
 use rustc_session::lint::{BufferedEarlyLint, LintBuffer, LintPass};
 use rustc_session::Session;
@@ -72,7 +73,7 @@ fn with_lint_attrs<F>(&mut self, id: ast::NodeId, attrs: &'a [ast::Attribute], f
         self.inlined_check_id(id);
         debug!("early context: enter_attrs({:?})", attrs);
         lint_callback!(self, enter_lint_attrs, attrs);
-        f(self);
+        ensure_sufficient_stack(|| f(self));
         debug!("early context: exit_attrs({:?})", attrs);
         lint_callback!(self, exit_lint_attrs, attrs);
         self.context.builder.pop(push);
@@ -247,7 +248,9 @@ fn visit_generics(&mut self, g: &'a ast::Generics) {
     }
 
     fn visit_where_predicate(&mut self, p: &'a ast::WherePredicate) {
+        lint_callback!(self, enter_where_predicate, p);
         ast_visit::walk_where_predicate(self, p);
+        lint_callback!(self, exit_where_predicate, p);
     }
 
     fn visit_poly_trait_ref(&mut self, t: &'a ast::PolyTraitRef) {