mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 14:01:51 +00:00
rustdoc: make item links consistently use title="{shortty} {path}"
The ordering in item tables was flipped in3030cbea95
, making it inconsistent with the ordering in method signatures. Compare these:c8e6a9e8b6/src/librustdoc/html/render/print_item.rs (L455-L459)
c8e6a9e8b6/src/librustdoc/html/format.rs (L903-L908)
This commit is contained in:
parent
c8e6a9e8b6
commit
57ca36861d
@ -452,7 +452,7 @@ fn item_module(w: &mut Buffer, cx: &mut Context<'_>, item: &clean::Item, items:
|
|||||||
stab = stab.unwrap_or_default(),
|
stab = stab.unwrap_or_default(),
|
||||||
unsafety_flag = unsafety_flag,
|
unsafety_flag = unsafety_flag,
|
||||||
href = item_path(myitem.type_(), myitem.name.unwrap().as_str()),
|
href = item_path(myitem.type_(), myitem.name.unwrap().as_str()),
|
||||||
title = [full_path(cx, myitem), myitem.type_().to_string()]
|
title = [myitem.type_().to_string(), full_path(cx, myitem)]
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|s| if !s.is_empty() { Some(s.as_str()) } else { None })
|
.filter_map(|s| if !s.is_empty() { Some(s.as_str()) } else { None })
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
|
@ -4,8 +4,8 @@ goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
|
|||||||
show-text: true
|
show-text: true
|
||||||
|
|
||||||
compare-elements-property: (
|
compare-elements-property: (
|
||||||
"//a[@title='test_docs::safe_fn fn']/..",
|
"//a[@title='fn test_docs::safe_fn']/..",
|
||||||
"//a[@title='test_docs::unsafe_fn fn']/..",
|
"//a[@title='fn test_docs::unsafe_fn']/..",
|
||||||
["clientHeight"]
|
["clientHeight"]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -11,6 +11,6 @@ pub mod sub {
|
|||||||
#[doc(inline)]
|
#[doc(inline)]
|
||||||
pub use sub::*;
|
pub use sub::*;
|
||||||
|
|
||||||
// @count foo/index.html '//a[@class="mod"][@title="foo::prelude mod"]' 1
|
// @count foo/index.html '//a[@class="mod"][@title="mod foo::prelude"]' 1
|
||||||
// @count foo/prelude/index.html '//div[@class="item-row"]' 0
|
// @count foo/prelude/index.html '//div[@class="item-row"]' 0
|
||||||
pub mod prelude {}
|
pub mod prelude {}
|
||||||
|
@ -8,7 +8,7 @@ pub mod sub {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// @count foo/index.html '//a[@class="mod"][@title="foo::prelude mod"]' 1
|
// @count foo/index.html '//a[@class="mod"][@title="mod foo::prelude"]' 1
|
||||||
// @count foo/prelude/index.html '//div[@class="item-row"]' 0
|
// @count foo/prelude/index.html '//div[@class="item-row"]' 0
|
||||||
pub mod prelude {}
|
pub mod prelude {}
|
||||||
|
|
||||||
|
@ -9,6 +9,6 @@ extern crate issue_99221_aux;
|
|||||||
|
|
||||||
pub use issue_99221_aux::*;
|
pub use issue_99221_aux::*;
|
||||||
|
|
||||||
// @count foo/index.html '//a[@class="struct"][@title="foo::Print struct"]' 1
|
// @count foo/index.html '//a[@class="struct"][@title="struct foo::Print"]' 1
|
||||||
|
|
||||||
pub struct Print;
|
pub struct Print;
|
||||||
|
@ -9,7 +9,7 @@ extern crate issue_99734_aux;
|
|||||||
|
|
||||||
pub use issue_99734_aux::*;
|
pub use issue_99734_aux::*;
|
||||||
|
|
||||||
// @count foo/index.html '//a[@class="fn"][@title="foo::main fn"]' 1
|
// @count foo/index.html '//a[@class="fn"][@title="fn foo::main"]' 1
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
pub fn main() -> std::ffi::c_int;
|
pub fn main() -> std::ffi::c_int;
|
||||||
|
@ -9,6 +9,6 @@ extern crate issue_99734_aux;
|
|||||||
|
|
||||||
pub use issue_99734_aux::*;
|
pub use issue_99734_aux::*;
|
||||||
|
|
||||||
// @count foo/index.html '//a[@class="mod"][@title="foo::task mod"]' 1
|
// @count foo/index.html '//a[@class="mod"][@title="mod foo::task"]' 1
|
||||||
|
|
||||||
pub mod task {}
|
pub mod task {}
|
||||||
|
Loading…
Reference in New Issue
Block a user