Skip to content

Commit b77aa74

Browse files
committed
Sort unstable items last in rustdoc, instead of first
1 parent a994f46 commit b77aa74

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/librustdoc/html/render/print_item.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,8 @@ fn item_module(w: &mut Buffer, cx: &mut Context<'_>, item: &clean::Item, items:
369369
if let (Some(a), Some(b)) = (s1, s2) {
370370
match (a.is_stable(), b.is_stable()) {
371371
(true, true) | (false, false) => {}
372-
(false, true) => return Ordering::Less,
373-
(true, false) => return Ordering::Greater,
372+
(false, true) => return Ordering::Greater,
373+
(true, false) => return Ordering::Less,
374374
}
375375
}
376376
let lhs = i1.name.unwrap_or(kw::Empty);

tests/rustdoc/stability.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
#![unstable(feature = "test", issue = "none")]
44

55
// @has stability/index.html
6-
// @has - '//ul[@class="item-table"]/li[1]//a' Unstable
7-
// @has - '//ul[@class="item-table"]/li[2]//a' AaStable
8-
// @has - '//ul[@class="item-table"]/li[3]//a' ZzStable
6+
// @has - '//ul[@class="item-table"]/li[1]//a' AaStable
7+
// @has - '//ul[@class="item-table"]/li[2]//a' ZzStable
8+
// @has - '//ul[@class="item-table"]/li[3]//a' Unstable
99

1010
#[stable(feature = "rust2", since = "2.2.2")]
1111
pub struct AaStable;

0 commit comments

Comments
 (0)