@@ -7,8 +7,6 @@ mod deprecated_semver;
77mod duplicated_attributes;
88mod empty_line_after;
99mod inline_always;
10- mod maybe_misused_cfg;
11- mod mismatched_target_os;
1210mod mixed_attributes_style;
1311mod non_minimal_cfg;
1412mod should_panic_without_expect;
@@ -270,39 +268,6 @@ declare_clippy_lint! {
270268 "usage of `cfg_attr(rustfmt)` instead of tool attributes"
271269}
272270
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-
306271declare_clippy_lint ! {
307272 /// ### What it does
308273 /// Checks for attributes that allow lints without a reason.
@@ -391,38 +356,6 @@ declare_clippy_lint! {
391356 "ensure that all `cfg(any())` and `cfg(all())` have more than one condition"
392357}
393358
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-
426359declare_clippy_lint ! {
427360 /// ### What it does
428361 /// Checks for `#[cfg_attr(feature = "cargo-clippy", ...)]` and for
@@ -612,11 +545,9 @@ pub struct EarlyAttributes {
612545
613546impl_lint_pass ! ( EarlyAttributes => [
614547 DEPRECATED_CFG_ATTR ,
615- MISMATCHED_TARGET_OS ,
616548 EMPTY_LINE_AFTER_OUTER_ATTR ,
617549 EMPTY_LINE_AFTER_DOC_COMMENTS ,
618550 NON_MINIMAL_CFG ,
619- MAYBE_MISUSED_CFG ,
620551 DEPRECATED_CLIPPY_CFG_ATTR ,
621552 UNNECESSARY_CLIPPY_CFG ,
622553] ) ;
@@ -629,9 +560,7 @@ impl EarlyLintPass for EarlyAttributes {
629560 fn check_attribute ( & mut self , cx : & EarlyContext < ' _ > , attr : & Attribute ) {
630561 deprecated_cfg_attr:: check ( cx, attr, & self . msrv ) ;
631562 deprecated_cfg_attr:: check_clippy ( cx, attr) ;
632- mismatched_target_os:: check ( cx, attr) ;
633563 non_minimal_cfg:: check ( cx, attr) ;
634- maybe_misused_cfg:: check ( cx, attr) ;
635564 }
636565
637566 extract_msrv_attr ! ( EarlyContext ) ;
0 commit comments