rust-playground
rust-playground copied to clipboard
"Test" and "Clippy" dead code warnings for code with main and tests
In this playground
fn main() {
println!("hello world");
}
or similar, using "Test" or "Clippy" gives dead code warnings:
Compiling playground v0.0.1 (/playground)
warning: function is never used: `main`
--> src/lib.rs:1:4
|
1 | fn main() {
| ^^^^
|
= note: `#[warn(dead_code)]` on by default
Finished test [unoptimized + debuginfo] target(s) in 0.73s
Looks like the code is put in lib.rs instead of main.rs. Pull Request #461 appears to have added support for passing the crate type to the backend, but I can't find anything in the interface to set the crate type — is it set heuristically?
Github just pinged me on this for some reason. Checked on the status: Clippy works fine now, but Test still complains.