From a994f46421f5ac551905e336c1c1b78a8885f6a5 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 23 Nov 2023 17:16:19 -0800 Subject: [PATCH] Add test of rustdoc sort order for stable vs unstable item --- tests/rustdoc/stability.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/rustdoc/stability.rs b/tests/rustdoc/stability.rs index 90be2050d92..5d8286d8116 100644 --- a/tests/rustdoc/stability.rs +++ b/tests/rustdoc/stability.rs @@ -2,6 +2,14 @@ #![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 + +#[stable(feature = "rust2", since = "2.2.2")] +pub struct AaStable; + pub struct Unstable { // @has stability/struct.Unstable.html \ // '//span[@class="item-info"]//div[@class="stab unstable"]' \ @@ -10,3 +18,6 @@ pub struct Unstable { pub foo: u32, pub bar: u32, } + +#[stable(feature = "rust2", since = "2.2.2")] +pub struct ZzStable;