Skip to content

Commit bb4ecc3

Browse files
committed
rustdoc: correct path to type alias methods
1 parent cb39073 commit bb4ecc3

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

src/librustdoc/formats/cache.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,8 @@ impl<'a, 'tcx> DocFolder for CacheBuilder<'a, 'tcx> {
293293
ItemType::Trait
294294
| ItemType::Struct
295295
| ItemType::Union
296-
| ItemType::Enum,
296+
| ItemType::Enum
297+
| ItemType::Typedef,
297298
)) => Some(&fqp[..fqp.len() - 1]),
298299
Some(..) => Some(&*self.cache.stack),
299300
None => None,

src/test/rustdoc-js-std/asrawfd.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// exact-match
2+
3+
const QUERY = 'RawFd::as_raw_fd';
4+
5+
const EXPECTED = {
6+
'others': [
7+
// Reproduction test for https://github.com/rust-lang/rust/issues/78724
8+
// Validate that type alias methods get the correct path.
9+
{ 'path': 'std::os::unix::io::AsRawFd', 'name': 'as_raw_fd' },
10+
{ 'path': 'std::os::wasi::io::AsRawFd', 'name': 'as_raw_fd' },
11+
{ 'path': 'std::os::linux::process::PidFd', 'name': 'as_raw_fd' },
12+
{ 'path': 'std::os::unix::io::RawFd', 'name': 'as_raw_fd' },
13+
],
14+
};

0 commit comments

Comments
 (0)