diff options
| author | David Tolnay <dtolnay@gmail.com> | 2023-11-23 16:38:31 -0800 |
|---|---|---|
| committer | David Tolnay <dtolnay@gmail.com> | 2023-11-23 17:20:13 -0800 |
| commit | b77aa74a2d6b0b5cac167a942a7c53931dc715c9 (patch) | |
| tree | 70fc08cdf8e201eb7227f5e6706d85b2618d37ca | |
| parent | a994f46421f5ac551905e336c1c1b78a8885f6a5 (diff) | |
| download | rust-b77aa74a2d6b0b5cac167a942a7c53931dc715c9.tar.gz rust-b77aa74a2d6b0b5cac167a942a7c53931dc715c9.zip | |
Sort unstable items last in rustdoc, instead of first
| -rw-r--r-- | src/librustdoc/html/render/print_item.rs | 4 | ||||
| -rw-r--r-- | tests/rustdoc/stability.rs | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs index 927bec4251e..ce9e1bcf488 100644 --- a/src/librustdoc/html/render/print_item.rs +++ b/src/librustdoc/html/render/print_item.rs @@ -369,8 +369,8 @@ fn item_module(w: &mut Buffer, cx: &mut Context<'_>, item: &clean::Item, items: if let (Some(a), Some(b)) = (s1, s2) { match (a.is_stable(), b.is_stable()) { (true, true) | (false, false) => {} - (false, true) => return Ordering::Less, - (true, false) => return Ordering::Greater, + (false, true) => return Ordering::Greater, + (true, false) => return Ordering::Less, } } let lhs = i1.name.unwrap_or(kw::Empty); diff --git a/tests/rustdoc/stability.rs b/tests/rustdoc/stability.rs index 5d8286d8116..c4d7118d07f 100644 --- a/tests/rustdoc/stability.rs +++ b/tests/rustdoc/stability.rs @@ -3,9 +3,9 @@ #![unstable(feature = "test", issue = "none")] // @has stability/index.html -// @has - '//ul[@class="item-table"]/li[1]//a' Unstable -// @has - '//ul[@class="item-table"]/li[2]//a' AaStable -// @has - '//ul[@class="item-table"]/li[3]//a' ZzStable +// @has - '//ul[@class="item-table"]/li[1]//a' AaStable +// @has - '//ul[@class="item-table"]/li[2]//a' ZzStable +// @has - '//ul[@class="item-table"]/li[3]//a' Unstable #[stable(feature = "rust2", since = "2.2.2")] pub struct AaStable; |
