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

dbg_macro not caught when in submodule #7275

Closed
vmalloc opened this issue May 26, 2021 · 1 comment · Fixed by #8411
Closed

dbg_macro not caught when in submodule #7275

vmalloc opened this issue May 26, 2021 · 1 comment · Fixed by #8411
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

@vmalloc
Copy link
Contributor

vmalloc commented May 26, 2021

Lint name: dbg_macro

I tried this code:

// src/main.rs
#![deny(warnings)]
#![deny(clippy::dbg_macro)]

mod sub;

fn main() {
    sub::func();
}


// src/sub.rs
pub fn func() {
    dbg!(10);
}

I expected the dbg! macro to be caught when running cargo clippy.

Instead, the lint does not trigger, and clippy finishes successfully.

The surprising bit (perhaps connected to #4612 ?) is when running clippy after forcefully touching the file (e.g. find . -name "*.rs" -exec touch {}), clippy catches it just fine 🤷

Meta

  • cargo clippy -V: clippy 0.1.52 (9bc8c42b 2021-05-09)
  • rustc -Vv:
    rustc 1.52.1 (9bc8c42bb 2021-05-09)
    

binary: rustc
commit-hash: 9bc8c42bb2f19e745a63f3445f1ac248fb015e53
commit-date: 2021-05-09
host: x86_64-apple-darwin
release: 1.52.1
LLVM version: 12.0.0

@vmalloc vmalloc 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 May 26, 2021
@ralpha
Copy link

ralpha commented Nov 19, 2021

I had the same problem with dbg_macro. (And maybe others.)
Even when using #![deny(clippy::all)] it did not report an error.
(rust: 1.56.1, Linux)

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.

2 participants