Rollup merge of #134880 - as1100k-forks:fix-rustdoc-json-path-name, r=aDotInTheVoid
Made `Path::name` only have item name rather than full name Closes #134853 This PR makes `Path::name` to only have item name rather than full name, i.e. with the following code ```rust pub mod foo { pub struct Bar; } pub fn get_bar() -> foo::Bar { foo::Bar } ``` and running `./rustdoc ./demo.rs -wjson -Zunstable-options` gives: ```json { "41": { "id": 41, "name": "get_bar", "inner": { "function": { "sig": { "inputs": [], "output": { "resolved_path": { "name": "Bar", "id": 0, "args": { "angle_bracketed": { "args": [], "constraints": [] } } } } } } } } } ``` _Information which isn't useful here was trimmed_ r? aDotInTheVoid
This commit is contained in:
commit
ca9a9d2f35
3 changed files with 3 additions and 3 deletions
|
@ -6,7 +6,7 @@ mod secret {
|
|||
}
|
||||
|
||||
//@ has "$.index[*][?(@.name=='get_secret')].inner.function"
|
||||
//@ is "$.index[*][?(@.name=='get_secret')].inner.function.sig.output.resolved_path.name" \"secret::Secret\"
|
||||
//@ is "$.index[*][?(@.name=='get_secret')].inner.function.sig.output.resolved_path.name" \"Secret\"
|
||||
pub fn get_secret() -> secret::Secret {
|
||||
secret::Secret
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue