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
1539
1539
None
1540
1540
}
1541
1541
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
1543
1544
///
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.
1545
1549
pub fn is_lint_allowed ( cx : & LateContext < ' _ > , lint : & ' static Lint , id : HirId ) -> bool {
1546
1550
cx. tcx . lint_level_at_node ( lint, id) . 0 == Level :: Allow
1547
1551
}
You can’t perform that action at this time.
0 commit comments