]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #55804 - QuietMisdreavus:eager-crate-inline, r=pnkfelix
authorkennytm <kennytm@gmail.com>
Tue, 13 Nov 2018 05:03:08 +0000 (13:03 +0800)
committerkennytm <kennytm@gmail.com>
Tue, 13 Nov 2018 11:20:25 +0000 (19:20 +0800)
rustdoc: don't inline `pub use some_crate` unless directly asked to

cc https://github.com/rust-lang/rust/issues/52509 (fixes it? i'm not sure about my comment summoning the docs team)

When rustdoc encounters a `pub use` statement for an item from another crate, it will eagerly inline its contents into your crate. This somewhat clashes with the new paths behavior in Rust 2018, in which crates are implicitly linked and re-exported with `pub use` instead of `pub extern crate`. In rust 2015, `pub extern crate` would only create a single line for its re-export in the docs, so i'm making it do the same with `pub use some_crate;`.

The exact new behavior is like this: *If rustdoc sees a `pub use` statement, and the item being imported is the root of another crate, it will only inline it if `#[doc(inline)]` is provided.* I made it only avoid crate roots because otherwise it would stop inlining any module, which may or may not be what people want.


Trivial merge