diff options
| author | binarycat <binarycat@envs.net> | 2025-05-27 12:42:25 -0500 |
|---|---|---|
| committer | binarycat <binarycat@envs.net> | 2025-06-10 12:56:58 -0500 |
| commit | 1140e90074b0cbcfdea8535e4b51877e2838227e (patch) | |
| tree | f3f3b850ab68799f03620f47e021b9e4163bb398 /tests/rustdoc-js | |
| parent | ccf3198de316b488ee17441935182e9d5292b4d3 (diff) | |
| download | rust-1140e90074b0cbcfdea8535e4b51877e2838227e.tar.gz rust-1140e90074b0cbcfdea8535e4b51877e2838227e.zip | |
rustdoc search: prefer stable items in search results
fixes https://github.com/rust-lang/rust/issues/138067
Diffstat (limited to 'tests/rustdoc-js')
| -rw-r--r-- | tests/rustdoc-js/sort-stability.js | 9 | ||||
| -rw-r--r-- | tests/rustdoc-js/sort-stability.rs | 16 |
2 files changed, 25 insertions, 0 deletions
diff --git a/tests/rustdoc-js/sort-stability.js b/tests/rustdoc-js/sort-stability.js new file mode 100644 index 00000000000..8c095619a08 --- /dev/null +++ b/tests/rustdoc-js/sort-stability.js @@ -0,0 +1,9 @@ +const EXPECTED = [ + { + 'query': 'foo', + 'others': [ + {"path": "sort_stability::old", "name": "foo"}, + {"path": "sort_stability::new", "name": "foo"}, + ], + }, +]; diff --git a/tests/rustdoc-js/sort-stability.rs b/tests/rustdoc-js/sort-stability.rs new file mode 100644 index 00000000000..68662bb3aab --- /dev/null +++ b/tests/rustdoc-js/sort-stability.rs @@ -0,0 +1,16 @@ +#![feature(staged_api)] +#![stable(feature = "foo_lib", since = "1.0.0")] + +#[stable(feature = "old_foo", since = "1.0.1")] +pub mod old { + /// Old, stable foo + #[stable(feature = "old_foo", since = "1.0.1")] + pub fn foo() {} +} + +#[unstable(feature = "new_foo", issue = "none")] +pub mod new { + /// New, unstable foo + #[unstable(feature = "new_foo", issue = "none")] + pub fn foo() {} +} |
