rustdoc: add regression test for #146216
This commit is contained in:
parent
e100792918
commit
28724dc541
2 changed files with 23 additions and 0 deletions
9
tests/rustdoc-js/alias-path-distance-146214.js
Normal file
9
tests/rustdoc-js/alias-path-distance-146214.js
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
// exact-check
|
||||
|
||||
// consider path distance for doc aliases
|
||||
// regression test for <https://github.com/rust-lang/rust/issues/146214>
|
||||
|
||||
const EXPECTED = {
|
||||
'query': 'Foo::zzz',
|
||||
'others': [{ 'path': 'alias_path_distance::Foo', 'name': 'baz' }],
|
||||
};
|
||||
14
tests/rustdoc-js/alias-path-distance-146214.rs
Normal file
14
tests/rustdoc-js/alias-path-distance-146214.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#![crate_name = "alias_path_distance"]
|
||||
|
||||
pub struct Foo;
|
||||
pub struct Bar;
|
||||
|
||||
impl Foo {
|
||||
#[doc(alias = "zzz")]
|
||||
pub fn baz() {}
|
||||
}
|
||||
|
||||
impl Bar {
|
||||
#[doc(alias = "zzz")]
|
||||
pub fn baz() {}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue