@@ -7,8 +7,6 @@ mod deprecated_semver;
7
7
mod duplicated_attributes;
8
8
mod empty_line_after;
9
9
mod inline_always;
10
- mod maybe_misused_cfg;
11
- mod mismatched_target_os;
12
10
mod mixed_attributes_style;
13
11
mod non_minimal_cfg;
14
12
mod should_panic_without_expect;
@@ -270,39 +268,6 @@ declare_clippy_lint! {
270
268
"usage of `cfg_attr(rustfmt)` instead of tool attributes"
271
269
}
272
270
273
- declare_clippy_lint ! {
274
- /// ### What it does
275
- /// Checks for cfg attributes having operating systems used in target family position.
276
- ///
277
- /// ### Why is this bad?
278
- /// The configuration option will not be recognised and the related item will not be included
279
- /// by the conditional compilation engine.
280
- ///
281
- /// ### Example
282
- /// ```no_run
283
- /// #[cfg(linux)]
284
- /// fn conditional() { }
285
- /// ```
286
- ///
287
- /// Use instead:
288
- /// ```no_run
289
- /// # mod hidden {
290
- /// #[cfg(target_os = "linux")]
291
- /// fn conditional() { }
292
- /// # }
293
- ///
294
- /// // or
295
- ///
296
- /// #[cfg(unix)]
297
- /// fn conditional() { }
298
- /// ```
299
- /// Check the [Rust Reference](https://doc.rust-lang.org/reference/conditional-compilation.html#target_os) for more details.
300
- #[ clippy:: version = "1.45.0" ]
301
- pub MISMATCHED_TARGET_OS ,
302
- correctness,
303
- "usage of `cfg(operating_system)` instead of `cfg(target_os = \" operating_system\" )`"
304
- }
305
-
306
271
declare_clippy_lint ! {
307
272
/// ### What it does
308
273
/// Checks for attributes that allow lints without a reason.
@@ -391,38 +356,6 @@ declare_clippy_lint! {
391
356
"ensure that all `cfg(any())` and `cfg(all())` have more than one condition"
392
357
}
393
358
394
- declare_clippy_lint ! {
395
- /// ### What it does
396
- /// Checks for `#[cfg(features = "...")]` and suggests to replace it with
397
- /// `#[cfg(feature = "...")]`.
398
- ///
399
- /// It also checks if `cfg(test)` was misspelled.
400
- ///
401
- /// ### Why is this bad?
402
- /// Misspelling `feature` as `features` or `test` as `tests` can be sometimes hard to spot. It
403
- /// may cause conditional compilation not work quietly.
404
- ///
405
- /// ### Example
406
- /// ```no_run
407
- /// #[cfg(features = "some-feature")]
408
- /// fn conditional() { }
409
- /// #[cfg(tests)]
410
- /// mod tests { }
411
- /// ```
412
- ///
413
- /// Use instead:
414
- /// ```no_run
415
- /// #[cfg(feature = "some-feature")]
416
- /// fn conditional() { }
417
- /// #[cfg(test)]
418
- /// mod tests { }
419
- /// ```
420
- #[ clippy:: version = "1.69.0" ]
421
- pub MAYBE_MISUSED_CFG ,
422
- suspicious,
423
- "prevent from misusing the wrong attr name"
424
- }
425
-
426
359
declare_clippy_lint ! {
427
360
/// ### What it does
428
361
/// Checks for `#[cfg_attr(feature = "cargo-clippy", ...)]` and for
@@ -612,11 +545,9 @@ pub struct EarlyAttributes {
612
545
613
546
impl_lint_pass ! ( EarlyAttributes => [
614
547
DEPRECATED_CFG_ATTR ,
615
- MISMATCHED_TARGET_OS ,
616
548
EMPTY_LINE_AFTER_OUTER_ATTR ,
617
549
EMPTY_LINE_AFTER_DOC_COMMENTS ,
618
550
NON_MINIMAL_CFG ,
619
- MAYBE_MISUSED_CFG ,
620
551
DEPRECATED_CLIPPY_CFG_ATTR ,
621
552
UNNECESSARY_CLIPPY_CFG ,
622
553
] ) ;
@@ -629,9 +560,7 @@ impl EarlyLintPass for EarlyAttributes {
629
560
fn check_attribute ( & mut self , cx : & EarlyContext < ' _ > , attr : & Attribute ) {
630
561
deprecated_cfg_attr:: check ( cx, attr, & self . msrv ) ;
631
562
deprecated_cfg_attr:: check_clippy ( cx, attr) ;
632
- mismatched_target_os:: check ( cx, attr) ;
633
563
non_minimal_cfg:: check ( cx, attr) ;
634
- maybe_misused_cfg:: check ( cx, attr) ;
635
564
}
636
565
637
566
extract_msrv_attr ! ( EarlyContext ) ;
0 commit comments