Closed
Description
With this code:
pub mod foo {
pub struct Bar;
}
pub fn get_bar() -> foo::Bar {
foo::Bar
}
Running rustdoc +nightly ./demo.rs -wjson -Zunstable-options
gives:
{
"inner": {
"function": {
"sig": {
"inputs": [],
"is_c_variadic": false,
"output": {
"resolved_path": {
"args": {"angle_bracketed": {"args": [], "constraints": []}},
"id": 0,
"name": "foo::Bar"
}
}
}
}
},
"name": "get_bar",
}
Where we have "name": "foo::Bar"
However the docs for Path::name
say:
The name of the type as declared, e.g. in
mod foo { struct Bar; }for
foo::Bar
, this field will beBar
.
Either we need to change the docs, or the how the field is generated. I'm not certain which is better.
version: rustdoc 1.85.0-nightly (dd84b7d 2024-12-27)
Originally reported by @AS1100K as rust-lang/rustdoc-types#45