Fix invalid path generation in rustdoc search
This commit is contained in:
@@ -1427,7 +1427,7 @@ impl<'a> Cache {
|
|||||||
}
|
}
|
||||||
if let Some(ref item_name) = item.name {
|
if let Some(ref item_name) = item.name {
|
||||||
let path = self.paths.get(&item.def_id)
|
let path = self.paths.get(&item.def_id)
|
||||||
.map(|p| p.0.join("::").to_string())
|
.map(|p| p.0[..p.0.len() - 1].join("::"))
|
||||||
.unwrap_or("std".to_owned());
|
.unwrap_or("std".to_owned());
|
||||||
for alias in item.attrs.lists("doc")
|
for alias in item.attrs.lists("doc")
|
||||||
.filter(|a| a.check_name("alias"))
|
.filter(|a| a.check_name("alias"))
|
||||||
|
|||||||
@@ -8,11 +8,13 @@
|
|||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
// ignore-order
|
||||||
|
|
||||||
const QUERY = '+';
|
const QUERY = '+';
|
||||||
|
|
||||||
const EXPECTED = {
|
const EXPECTED = {
|
||||||
'others': [
|
'others': [
|
||||||
{ 'path': 'std::ops::AddAssign', 'name': 'AddAssign' },
|
{ 'path': 'std::ops', 'name': 'AddAssign' },
|
||||||
{ 'path': 'std::ops::Add', 'name': 'Add' },
|
{ 'path': 'std::ops', 'name': 'Add' },
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ const QUERY = '[';
|
|||||||
const EXPECTED = {
|
const EXPECTED = {
|
||||||
'others': [
|
'others': [
|
||||||
{ 'path': 'std', 'name': 'slice' },
|
{ 'path': 'std', 'name': 'slice' },
|
||||||
{ 'path': 'std::ops::IndexMut', 'name': 'IndexMut' },
|
{ 'path': 'std::ops', 'name': 'IndexMut' },
|
||||||
{ 'path': 'std::ops::Index', 'name': 'Index' },
|
{ 'path': 'std::ops', 'name': 'Index' },
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user