rustdoc: add regression test for #146216

This commit is contained in:
binarycat 2025-10-14 14:36:01 -05:00
parent e100792918
commit 28724dc541
2 changed files with 23 additions and 0 deletions

View 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' }],
};

View 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() {}
}