Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Y-Nak opened this issue Mar 19, 2021 · 1 comment · Fixed by #6938
Closed

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

Y-Nak opened this issue Mar 19, 2021 · 1 comment · Fixed by #6938
Assignees
Labels
C-bug Category: Clippy is not doing the correct thing I-false-negative Issue: The lint should have been triggered on code, but wasn't

Comments

@Y-Nak
Copy link
Contributor

Y-Nak commented Mar 19, 2021

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
@Y-Nak Y-Nak added C-bug Category: Clippy is not doing the correct thing I-false-negative Issue: The lint should have been triggered on code, but wasn't labels Mar 19, 2021
@Y-Nak
Copy link
Contributor Author

Y-Nak commented Mar 19, 2021

@rustbot claim

@Y-Nak Y-Nak changed the title FN: types in const/static item FN: All lints in types don't work if a type is in const or static Mar 19, 2021
@Y-Nak Y-Nak mentioned this issue Mar 20, 2021
@bors bors closed this as completed in 2e33bf6 Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing I-false-negative Issue: The lint should have been triggered on code, but wasn't
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant