Skip to content

deprecated_cfg_attr hit in MSRV 1.29.0 #7922

Closed
@Kixunil

Description

@Kixunil

Lint name: deprecated_cfg_attr

The suggested code doesn't work in the configured MSRV.

I tried this code:

#[cfg_attr(rustfmt, rustfmt_skip)]
macro_rules! foo {
...
}

with this configuration

msrv = "1.29"

I expected to see this happen: Clippy should see that #[rustfmt::skip] is not available in 1.29 and ignore it

Instead, this happened: Clippy suggested #[rustfmt::skip], which fails with old version of Rust.

Meta

Rust version (rustc -Vv):

rustc 1.58.0-nightly (18bc4bee9 2021-11-02)
binary: rustc
commit-hash: 18bc4bee9710b181b440a472635150f0d6257713
commit-date: 2021-11-02
host: x86_64-unknown-linux-gnu
release: 1.58.0-nightly
LLVM version: 13.0.0

@rustbot label +I-suggestion-causes-error

Metadata

Metadata

Assignees

Labels

C-bugCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't haveI-suggestion-causes-errorIssue: The suggestions provided by this Lint cause an ICE/error when appliedgood first issueThese issues are a good way to get started with Clippy

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions