]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_lint/src/early.rs
Rollup merge of #107631 - BoxyUwU:triagebot_cargo_lock, r=compiler-errors
[rust.git] / compiler / rustc_lint / src / early.rs
index 58b1ae6e800108e9e5fc6be4ce5df6fe2af6836e..337a19dd024d2fec195601c77de253036df847bf 100644 (file)
@@ -1,5 +1,3 @@
-#![deny(rustc::untranslatable_diagnostic)]
-#![deny(rustc::diagnostic_outside_of_impl)]
 //! Implementation of lint checking.
 //!
 //! The lint checking is mostly consolidated into one pass which runs
@@ -21,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;
@@ -74,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);
@@ -249,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) {