Skip to content

FN: All lints in types don't work if a type is in const or static #6936

Closed
@Y-Nak

Description

@Y-Nak

All lints in types don't work if types are in const or static.

I tried this code:

#![allow(unused)]
#![deny(clippy::option_option, clippy::vec_box)]

const C1: Option<Option<i32>> = None;
const C2: Vec<Box<i32>> = Vec::new();

I expected to see this happen: option_option and vec_box should be triggered.

Instead, this happened: Nothing.

Meta

  • cargo clippy -V: clippy 0.1.52 (f5d8117 2021-03-16)
  • rustc -Vv:
rustc 1.52.0-nightly (f5d8117c3 2021-03-16)
binary: rustc
commit-hash: f5d8117c338a788bd24abec733fd143dfceb25a0
commit-date: 2021-03-16
host: x86_64-unknown-linux-gnu
release: 1.52.0-nightly
LLVM version: 12.0.0

Metadata

Metadata

Assignees

Labels

C-bugCategory: Clippy is not doing the correct thingI-false-negativeIssue: The lint should have been triggered on code, but wasn't

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions