File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1539,9 +1539,13 @@ pub fn is_try<'tcx>(cx: &LateContext<'_>, expr: &'tcx Expr<'tcx>) -> Option<&'tc
15391539 None
15401540}
15411541
1542- /// Returns `true` if the lint is allowed in the current context
1542+ /// Returns `true` if the lint is allowed in the current context. This is useful for
1543+ /// skipping long running code when it's unnecessary
15431544///
1544- /// Useful for skipping long running code when it's unnecessary
1545+ /// This function should check the lint level for the same node, that the lint will
1546+ /// be emitted at. If the information is buffered to be emitted at a later point, please
1547+ /// make sure to use `span_lint_hir` functions to emit the lint. This ensures that
1548+ /// expectations at the checked nodes will be fulfilled.
15451549pub fn is_lint_allowed ( cx : & LateContext < ' _ > , lint : & ' static Lint , id : HirId ) -> bool {
15461550 cx. tcx . lint_level_at_node ( lint, id) . 0 == Level :: Allow
15471551}
You can’t perform that action at this time.
0 commit comments