main.rs
#![deny(clippy::print_stdout)]
mod foo;
#[allow(clippy::print_stdout)]
fn main() {
println!("Hello, world!");
}
foo.rs
pub fn foo() {
println!("This should trigger clippy");
}
clippy output
/home/tobin/.cargo/bin/cargo clippy --all-targets -Zunstable-options --manifest-path /home/tobin/tmp/clippy/Cargo.toml
warning: function is never used: `foo`
--> src/foo.rs:1:8
|
1 | pub fn foo() {
| ^^^
|
= note: `#[warn(dead_code)]` on by default
warning: 1 warning emitted
warning: function is never used: `foo`
--> src/foo.rs:1:8
|
1 | pub fn foo() {
| ^^^
|
= note: `#[warn(dead_code)]` on by default
warning: 1 warning emitted
Finished dev [unoptimized + debuginfo] target(s) in 0.00s
Cargo-Process finished at Wed Jan 20 15:17:11
Here we see that clippy parses foo.rs
but does not pick up the print statement.