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

Denying print_stdout lint in src/lib.rs does not catch println!()s in modules #8023

Closed
jszwedko opened this issue Nov 22, 2021 · 1 comment
Closed
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

@jszwedko
Copy link

Lint name: print_stdout

I might be misunderstanding something, but usually I put lints in src/lib.rs to deny them for all modules. This works for other lints, but seems to not work for the print_stdout lint?

I tried this code:

https://gist.github.com/jszwedko/59e2fad1a7d4e0c36b96a802a99e25fc

I expected to see this happen: clippy output a warning for the println!() in src/foo/mod.rs

Instead, this happened: clippy did not output any warnings.

Meta

Rust version (rustc -Vv):

rustc 1.56.1 (59eed8a2a 2021-11-01)
binary: rustc
commit-hash: 59eed8a2aac0230a8b53e89d4e99d55912ba6b35
commit-date: 2021-11-01
host: x86_64-apple-darwin
release: 1.56.1
LLVM version: 13.0.0
@jszwedko jszwedko 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 Nov 22, 2021
@flip1995
Copy link
Member

Duplicate of #6610

This is because the print_stdout is a pre-expansion pass lint. We have to get rid of those lints at some point. The challenge with that is, that we have to rewrite those lints before we can do that.

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

No branches or pull requests

2 participants