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.
Allow expanding a tuple type `T` in a list of types with `..T`.
Add tests for tuple expansion in type lists.