@@ -6,7 +6,6 @@ mod blanket_clippy_restriction_lints;
6
6
mod deprecated_cfg_attr;
7
7
mod deprecated_semver;
8
8
mod duplicated_attributes;
9
- mod empty_line_after;
10
9
mod inline_always;
11
10
mod mixed_attributes_style;
12
11
mod non_minimal_cfg;
@@ -127,94 +126,6 @@ declare_clippy_lint! {
127
126
"use of `#[deprecated(since = \" x\" )]` where x is not semver"
128
127
}
129
128
130
- declare_clippy_lint ! {
131
- /// ### What it does
132
- /// Checks for empty lines after outer attributes
133
- ///
134
- /// ### Why is this bad?
135
- /// Most likely the attribute was meant to be an inner attribute using a '!'.
136
- /// If it was meant to be an outer attribute, then the following item
137
- /// should not be separated by empty lines.
138
- ///
139
- /// ### Known problems
140
- /// Can cause false positives.
141
- ///
142
- /// From the clippy side it's difficult to detect empty lines between an attributes and the
143
- /// following item because empty lines and comments are not part of the AST. The parsing
144
- /// currently works for basic cases but is not perfect.
145
- ///
146
- /// ### Example
147
- /// ```no_run
148
- /// #[allow(dead_code)]
149
- ///
150
- /// fn not_quite_good_code() { }
151
- /// ```
152
- ///
153
- /// Use instead:
154
- /// ```no_run
155
- /// // Good (as inner attribute)
156
- /// #![allow(dead_code)]
157
- ///
158
- /// fn this_is_fine() { }
159
- ///
160
- /// // or
161
- ///
162
- /// // Good (as outer attribute)
163
- /// #[allow(dead_code)]
164
- /// fn this_is_fine_too() { }
165
- /// ```
166
- #[ clippy:: version = "pre 1.29.0" ]
167
- pub EMPTY_LINE_AFTER_OUTER_ATTR ,
168
- nursery,
169
- "empty line after outer attribute"
170
- }
171
-
172
- declare_clippy_lint ! {
173
- /// ### What it does
174
- /// Checks for empty lines after documentation comments.
175
- ///
176
- /// ### Why is this bad?
177
- /// The documentation comment was most likely meant to be an inner attribute or regular comment.
178
- /// If it was intended to be a documentation comment, then the empty line should be removed to
179
- /// be more idiomatic.
180
- ///
181
- /// ### Known problems
182
- /// Only detects empty lines immediately following the documentation. If the doc comment is followed
183
- /// by an attribute and then an empty line, this lint will not trigger. Use `empty_line_after_outer_attr`
184
- /// in combination with this lint to detect both cases.
185
- ///
186
- /// Does not detect empty lines after doc attributes (e.g. `#[doc = ""]`).
187
- ///
188
- /// ### Example
189
- /// ```no_run
190
- /// /// Some doc comment with a blank line after it.
191
- ///
192
- /// fn not_quite_good_code() { }
193
- /// ```
194
- ///
195
- /// Use instead:
196
- /// ```no_run
197
- /// /// Good (no blank line)
198
- /// fn this_is_fine() { }
199
- /// ```
200
- ///
201
- /// ```no_run
202
- /// // Good (convert to a regular comment)
203
- ///
204
- /// fn this_is_fine_too() { }
205
- /// ```
206
- ///
207
- /// ```no_run
208
- /// //! Good (convert to a comment on an inner attribute)
209
- ///
210
- /// fn this_is_fine_as_well() { }
211
- /// ```
212
- #[ clippy:: version = "1.70.0" ]
213
- pub EMPTY_LINE_AFTER_DOC_COMMENTS ,
214
- nursery,
215
- "empty line after documentation comments"
216
- }
217
-
218
129
declare_clippy_lint ! {
219
130
/// ### What it does
220
131
/// Checks for `warn`/`deny`/`forbid` attributes targeting the whole clippy::restriction category.
@@ -594,18 +505,12 @@ pub struct EarlyAttributes {
594
505
595
506
impl_lint_pass ! ( EarlyAttributes => [
596
507
DEPRECATED_CFG_ATTR ,
597
- EMPTY_LINE_AFTER_OUTER_ATTR ,
598
- EMPTY_LINE_AFTER_DOC_COMMENTS ,
599
508
NON_MINIMAL_CFG ,
600
509
DEPRECATED_CLIPPY_CFG_ATTR ,
601
510
UNNECESSARY_CLIPPY_CFG ,
602
511
] ) ;
603
512
604
513
impl EarlyLintPass for EarlyAttributes {
605
- fn check_item ( & mut self , cx : & EarlyContext < ' _ > , item : & rustc_ast:: Item ) {
606
- empty_line_after:: check ( cx, item) ;
607
- }
608
-
609
514
fn check_attribute ( & mut self , cx : & EarlyContext < ' _ > , attr : & Attribute ) {
610
515
deprecated_cfg_attr:: check ( cx, attr, & self . msrv ) ;
611
516
deprecated_cfg_attr:: check_clippy ( cx, attr) ;
0 commit comments