]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #39740 - jimmycuadra:rustdoc-empty-stability, r=aturon
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Sun, 12 Feb 2017 18:16:31 +0000 (19:16 +0100)
committerGitHub <noreply@github.com>
Sun, 12 Feb 2017 18:16:31 +0000 (19:16 +0100)
commit74204a0ce70eb8c0d128adc52fdad416d9c3fb86
tree33ea3ee10442ca6ae7a542f68a1bc60fe08626ca
parent0095ec25cc3563e2f3d2237342b4504e0257f8a9
parent1fa9dbc00e8d5eff8f698097afb112c142bb8da0
Rollup merge of #39740 - jimmycuadra:rustdoc-empty-stability, r=aturon

rustdoc: Only include a stability span if needed.

This patch gets rid of the empty stability boxes in docs by only including the span that creates it when the item actually has a stability class.

Here are images of the issue on `std::process::Output`:

Before:

<img width="340" alt="before" src="https://cloud.githubusercontent.com/assets/122457/22853638/ff88d1b2-f010-11e6-90d6-bf3d10e2fffa.png">

After:

<img width="333" alt="after" src="https://cloud.githubusercontent.com/assets/122457/22853639/06bfe7cc-f011-11e6-9892-f0ea2cc6ec90.png">

This is my first non-trivial patch to Rust, so I'm sure some of my approach is not idiomatic. Let me know how you'd like me to adjust!
src/librustdoc/html/render.rs