@@ -4,13 +4,20 @@ use clippy_utils::diagnostics::span_lint_and_then;
4
4
use clippy_utils:: get_attr;
5
5
use rustc_ast:: { ast, token, tokenstream} ;
6
6
use rustc_data_structures:: fx:: { FxHashMap , FxHashSet , StdEntry } ;
7
- use rustc_hir:: * ;
7
+ use rustc_hir:: { def , def_id , Expr , ExprKind , QPath } ;
8
8
use rustc_lint:: { LateContext , LateLintPass , LintContext } ;
9
9
use rustc_session:: { declare_tool_lint, impl_lint_pass} ;
10
10
use rustc_span:: { Span , Symbol } ;
11
11
12
- // TODO: Safety override
13
- // TODO: Config
12
+ // Future improvements:
13
+ //
14
+ // - Allow users to override modules as *not* having a specific danger.
15
+ // - Allow users to specify additional dangerous items in the clippy config.
16
+ // - Devise a scheme (maybe path compression?) to reduce the amount of ancestry tracing we have to
17
+ // do to determine the dangers posed by a method?
18
+ // - Implement a way to forbid `accept_danger` in a given module.
19
+ // - Allow `accept_danger` and `dangerous` as internal attributes on stable Rust?
20
+ //
14
21
15
22
declare_clippy_lint ! {
16
23
/// ### What it does
@@ -84,6 +91,7 @@ pub struct DangerNotAccepted {
84
91
impl_lint_pass ! ( DangerNotAccepted => [ DANGER_NOT_ACCEPTED ] ) ;
85
92
86
93
impl LateLintPass < ' _ > for DangerNotAccepted {
94
+ #[ allow( clippy:: needless_return, reason = "unified syntax improves readability" ) ]
87
95
fn check_expr ( & mut self , cx : & LateContext < ' _ > , expr : & ' _ Expr < ' _ > ) {
88
96
// If we're calling a method...
89
97
if let ExprKind :: MethodCall ( _path, _, _self_arg, ..) = & expr. kind
0 commit comments