File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,12 @@ use crate::errors::{
28
28
UnknownToolInScopedLint ,
29
29
} ;
30
30
31
+ /// Collection of lint levels for the whole crate.
32
+ /// This is used by AST-based lints, which do not
33
+ /// wait until we have built HIR to be emitted.
31
34
#[ derive( Debug ) ]
32
35
struct LintLevelSets {
36
+ /// Linked list of specifications.
33
37
list : IndexVec < LintStackIndex , LintSet > ,
34
38
}
35
39
@@ -40,12 +44,19 @@ rustc_index::newtype_index! {
40
44
}
41
45
}
42
46
47
+ /// Specifications found at this position in the stack. This map only represents the lints
48
+ /// found for one set of attributes (like `shallow_lint_levels_on` does).
49
+ ///
50
+ /// We store the level specifications as a linked list.
51
+ /// Each `LintSet` represents a set of attributes on the same AST node.
52
+ /// The `parent` forms a linked list that matches the AST tree.
53
+ /// This way, walking the linked list is equivalent to walking the AST bottom-up
54
+ /// to find the specifications for a given lint.
43
55
#[ derive( Debug ) ]
44
56
struct LintSet {
45
57
// -A,-W,-D flags, a `Symbol` for the flag itself and `Level` for which
46
58
// flag.
47
59
specs : FxHashMap < LintId , LevelAndSource > ,
48
-
49
60
parent : LintStackIndex ,
50
61
}
51
62
You can’t perform that action at this time.
0 commit comments