-
Notifications
You must be signed in to change notification settings - Fork 14k
Closed
Labels
T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Description
rustdoc warns that main is never used.
// hello.rs
#![crate_id="hello"]
fn main() {}$ rustdoc hello.rs
hello.rs:3:1: 3:13 warning: code is never used: `main`, #[warn(dead_code)] on by default
hello.rs:3 fn main() {}
^~~~~~~~~~~~
I think rustdoc shouldn't warn about it, because rustc doesn't warn.
$ rustc hello.rs
# no output
If the main is pub, rustdoc doesn't warn about it. Shoulud all mains mark as pub?
// pubhello.rs
#![crate_id="hello"]
pub fn main() {}$ rustdoc pubhello.rs
# no output
$ rustc --version
rustc 0.11-pre (9f836d5 2014-05-01 16:06:48 -0700)
host: x86_64-unknown-linux-gnu
$ rustdoc --version
rustdoc 0.11-pre (9f836d5 2014-05-01 16:06:48 -0700)
host: x86_64-unknown-linux-gnu
Metadata
Metadata
Assignees
Labels
T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.