Skip to content

Clippy suggests an unstable attribute instead of a deprecated one for #[cfg_attr(rustfmt, rustfmt_skip)] #88591

Open
@stephanemagnenat

Description

@stephanemagnenat

I'm disabling rustfmt for some lines of my code because I have functions with multiple arguments and for the sake of exposing the logical reasoning of the algorithm, I want to group them on multiple lines. Therefore, I am using:

#[cfg_attr(rustfmt, rustfmt_skip)]
...

Running cargo clippy tells me:

`cfg_attr` is deprecated for rustfmt and got replaced by tool attributes
...
help: use: `#[rustfmt::skip]`

However, if I replace these with #[rustfmt::skip], I'm getting the following error:

error[E0658]: attributes on expressions are experimental
...
note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information

I assume it is a bug for a tool in stable Rust to suggest to use an experimental code to replace valid (although deprecated) code.

Meta

rustc --version --verbose:

rustc 1.53.0 (53cb7b09b 2021-06-17)
binary: rustc
commit-hash: 53cb7b09b00cbea8754ffb78e7e3cb521cb8af4b
commit-date: 2021-06-17
host: x86_64-unknown-linux-gnu
release: 1.53.0
LLVM version: 12.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-attributesArea: Attributes (`#[…]`, `#![…]`)A-clippyArea: ClippyC-bugCategory: This is a bug.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions