rustdoc: Tell rustc we're building a library

This makes sure that when generating documentation we don't waste time doing
things like looking for a main function.
auto merge of #10782 : alexcrichton/rust/rustdoc-lib, r=thestinger

This makes sure that when generating documentation we don't waste time doing
things like looking for a main function.