@@ -30,7 +30,6 @@ pub mod sym_helper;
30
30
#[ allow( clippy:: module_name_repetitions) ]
31
31
pub mod ast_utils;
32
32
pub mod attrs;
33
- pub mod author;
34
33
pub mod camel_case;
35
34
pub mod comparisons;
36
35
pub mod conf;
@@ -39,9 +38,6 @@ mod diagnostics;
39
38
pub mod eager_or_lazy;
40
39
pub mod higher;
41
40
mod hir_utils;
42
- pub mod inspector;
43
- #[ cfg( feature = "internal-lints" ) ]
44
- pub mod internal_lints;
45
41
pub mod numeric_literal;
46
42
pub mod paths;
47
43
pub mod ptr;
@@ -90,105 +86,6 @@ use smallvec::SmallVec;
90
86
91
87
use crate :: consts:: { constant, Constant } ;
92
88
93
- /// Macro used to declare a Clippy lint.
94
- ///
95
- /// Every lint declaration consists of 4 parts:
96
- ///
97
- /// 1. The documentation, which is used for the website
98
- /// 2. The `LINT_NAME`. See [lint naming][lint_naming] on lint naming conventions.
99
- /// 3. The `lint_level`, which is a mapping from *one* of our lint groups to `Allow`, `Warn` or
100
- /// `Deny`. The lint level here has nothing to do with what lint groups the lint is a part of.
101
- /// 4. The `description` that contains a short explanation on what's wrong with code where the
102
- /// lint is triggered.
103
- ///
104
- /// Currently the categories `style`, `correctness`, `complexity` and `perf` are enabled by default.
105
- /// As said in the README.md of this repository, if the lint level mapping changes, please update
106
- /// README.md.
107
- ///
108
- /// # Example
109
- ///
110
- /// ```
111
- /// #![feature(rustc_private)]
112
- /// extern crate rustc_session;
113
- /// use rustc_session::declare_tool_lint;
114
- /// use clippy_utils::declare_clippy_lint;
115
- ///
116
- /// declare_clippy_lint! {
117
- /// /// **What it does:** Checks for ... (describe what the lint matches).
118
- /// ///
119
- /// /// **Why is this bad?** Supply the reason for linting the code.
120
- /// ///
121
- /// /// **Known problems:** None. (Or describe where it could go wrong.)
122
- /// ///
123
- /// /// **Example:**
124
- /// ///
125
- /// /// ```rust
126
- /// /// // Bad
127
- /// /// Insert a short example of code that triggers the lint
128
- /// ///
129
- /// /// // Good
130
- /// /// Insert a short example of improved code that doesn't trigger the lint
131
- /// /// ```
132
- /// pub LINT_NAME,
133
- /// pedantic,
134
- /// "description"
135
- /// }
136
- /// ```
137
- /// [lint_naming]: https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints
138
- #[ macro_export]
139
- macro_rules! declare_clippy_lint {
140
- { $( #[ $attr: meta] ) * pub $name: tt, style, $description: tt } => {
141
- declare_tool_lint! {
142
- $( #[ $attr] ) * pub clippy:: $name, Warn , $description, report_in_external_macro: true
143
- }
144
- } ;
145
- { $( #[ $attr: meta] ) * pub $name: tt, correctness, $description: tt } => {
146
- declare_tool_lint! {
147
- $( #[ $attr] ) * pub clippy:: $name, Deny , $description, report_in_external_macro: true
148
- }
149
- } ;
150
- { $( #[ $attr: meta] ) * pub $name: tt, complexity, $description: tt } => {
151
- declare_tool_lint! {
152
- $( #[ $attr] ) * pub clippy:: $name, Warn , $description, report_in_external_macro: true
153
- }
154
- } ;
155
- { $( #[ $attr: meta] ) * pub $name: tt, perf, $description: tt } => {
156
- declare_tool_lint! {
157
- $( #[ $attr] ) * pub clippy:: $name, Warn , $description, report_in_external_macro: true
158
- }
159
- } ;
160
- { $( #[ $attr: meta] ) * pub $name: tt, pedantic, $description: tt } => {
161
- declare_tool_lint! {
162
- $( #[ $attr] ) * pub clippy:: $name, Allow , $description, report_in_external_macro: true
163
- }
164
- } ;
165
- { $( #[ $attr: meta] ) * pub $name: tt, restriction, $description: tt } => {
166
- declare_tool_lint! {
167
- $( #[ $attr] ) * pub clippy:: $name, Allow , $description, report_in_external_macro: true
168
- }
169
- } ;
170
- { $( #[ $attr: meta] ) * pub $name: tt, cargo, $description: tt } => {
171
- declare_tool_lint! {
172
- $( #[ $attr] ) * pub clippy:: $name, Allow , $description, report_in_external_macro: true
173
- }
174
- } ;
175
- { $( #[ $attr: meta] ) * pub $name: tt, nursery, $description: tt } => {
176
- declare_tool_lint! {
177
- $( #[ $attr] ) * pub clippy:: $name, Allow , $description, report_in_external_macro: true
178
- }
179
- } ;
180
- { $( #[ $attr: meta] ) * pub $name: tt, internal, $description: tt } => {
181
- declare_tool_lint! {
182
- $( #[ $attr] ) * pub clippy:: $name, Allow , $description, report_in_external_macro: true
183
- }
184
- } ;
185
- { $( #[ $attr: meta] ) * pub $name: tt, internal_warn, $description: tt } => {
186
- declare_tool_lint! {
187
- $( #[ $attr] ) * pub clippy:: $name, Warn , $description, report_in_external_macro: true
188
- }
189
- } ;
190
- }
191
-
192
89
pub fn parse_msrv ( msrv : & str , sess : Option < & Session > , span : Option < Span > ) -> Option < RustcVersion > {
193
90
if let Ok ( version) = RustcVersion :: parse ( msrv) {
194
91
return Some ( version) ;
0 commit comments