Rollup merge of #141658 - lolbinarycat:rustdoc-search-stability-rank-138067, r=GuillaumeGomez
rustdoc search: prefer stable items in search results fixes https://github.com/rust-lang/rust/issues/138067 this does add a new field to the search index, but since we're only listing unstable items instead of adding a boolean flag to every item, it should only increase the search index size of sysroot crates, since those are the only ones using the `staged_api` feature, at least as far as the rust project is concerned.
This commit is contained in:
commit
48f5929604
10 changed files with 65 additions and 4 deletions
9
tests/rustdoc-js/sort-stability.js
Normal file
9
tests/rustdoc-js/sort-stability.js
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
const EXPECTED = [
|
||||
{
|
||||
'query': 'foo',
|
||||
'others': [
|
||||
{"path": "sort_stability::old", "name": "foo"},
|
||||
{"path": "sort_stability::new", "name": "foo"},
|
||||
],
|
||||
},
|
||||
];
|
||||
16
tests/rustdoc-js/sort-stability.rs
Normal file
16
tests/rustdoc-js/sort-stability.rs
Normal file
|
|
@ -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() {}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue