|
1 | | -//! Implementation of lint checking. |
| 1 | +//! Basic types for managing and implementing lints. |
2 | 2 | //! |
3 | | -//! The lint checking is mostly consolidated into one pass which runs |
4 | | -//! after all other analyses. Throughout compilation, lint warnings |
5 | | -//! can be added via the `add_lint` method on the Session structure. This |
6 | | -//! requires a span and an ID of the node that the lint is being added to. The |
7 | | -//! lint isn't actually emitted at that time because it is unknown what the |
8 | | -//! actual lint level at that location is. |
9 | | -//! |
10 | | -//! To actually emit lint warnings/errors, a separate pass is used. |
11 | | -//! A context keeps track of the current state of all lint levels. |
12 | | -//! Upon entering a node of the ast which can modify the lint settings, the |
13 | | -//! previous lint state is pushed onto a stack and the ast is then recursed |
14 | | -//! upon. As the ast is traversed, this keeps track of the current lint level |
15 | | -//! for all lint attributes. |
| 3 | +//! See <https://rustc-dev-guide.rust-lang.org/diagnostics.html> for an |
| 4 | +//! overview of how lints are implemented. |
16 | 5 |
|
17 | 6 | use std::cell::Cell; |
18 | 7 | use std::{iter, slice}; |
@@ -52,9 +41,6 @@ type LateLintPassFactory = |
52 | 41 | dyn for<'tcx> Fn(TyCtxt<'tcx>) -> LateLintPassObject<'tcx> + sync::DynSend + sync::DynSync; |
53 | 42 |
|
54 | 43 | /// Information about the registered lints. |
55 | | -/// |
56 | | -/// This is basically the subset of `Context` that we can |
57 | | -/// build early in the compile pipeline. |
58 | 44 | pub struct LintStore { |
59 | 45 | /// Registered lints. |
60 | 46 | lints: Vec<&'static Lint>, |
|
0 commit comments