Closed
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 main
s 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