rust/tests/rustdoc-json
Matthias Krüger ca9a9d2f35
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
2025-01-14 19:25:05 +01:00
..
enums rustdoc: normalise type/field names in rustdoc-json-types/jsondoclint 2024-09-01 23:58:08 +03:00
fn_pointer rustdoc: normalise type/field names in rustdoc-json-types/jsondoclint 2024-09-01 23:58:08 +03:00
fns Remove unadorned 2024-10-11 11:30:08 -04:00
generic-associated-types rustdoc: normalise type/field names in rustdoc-json-types/jsondoclint 2024-09-01 23:58:08 +03:00
impls rustdoc-json: Add test for impl Trait for dyn Trait 2024-12-01 23:13:57 +00:00
intra-doc-links Update all rustdoc-json/ tests to use the new style 2024-07-19 16:54:42 +02:00
lifetime rustdoc: normalise type/field names in rustdoc-json-types/jsondoclint 2024-09-01 23:58:08 +03:00
methods rustdoc: normalise type/field names in rustdoc-json-types/jsondoclint 2024-09-01 23:58:08 +03:00
primitives rustdoc: normalise type/field names in rustdoc-json-types/jsondoclint 2024-09-01 23:58:08 +03:00
reexport rustdoc-json: Include items in stripped modules in Crate::paths. 2025-01-10 23:51:45 +00:00
statics rustdoc-json: Include safety of statics 2024-12-01 21:39:58 +00:00
structs rustdoc: normalise type/field names in rustdoc-json-types/jsondoclint 2024-09-01 23:58:08 +03:00
traits rustdoc-JSON: Rename "object safe" to "dyn compatible" 2024-10-16 23:00:49 +02:00
type Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
unions rustdoc: normalise type/field names in rustdoc-json-types/jsondoclint 2024-09-01 23:58:08 +03:00
assoc_items.rs rustdoc: normalise type/field names in rustdoc-json-types/jsondoclint 2024-09-01 23:58:08 +03:00
assoc_type.rs Update all rustdoc-json/ tests to use the new style 2024-07-19 16:54:42 +02:00
blanket_impls.rs rustdoc: normalise type/field names in rustdoc-json-types/jsondoclint 2024-09-01 23:58:08 +03:00
doc_hidden_failure.rs Update all rustdoc-json/ tests to use the new style 2024-07-19 16:54:42 +02:00
generic_impl.rs Update all rustdoc-json/ tests to use the new style 2024-07-19 16:54:42 +02:00
glob_import.rs rustdoc: normalise type/field names in rustdoc-json-types/jsondoclint 2024-09-01 23:58:08 +03:00
impl-trait-in-assoc-type.rs rustdoc: normalise type/field names in rustdoc-json-types/jsondoclint 2024-09-01 23:58:08 +03:00
impl-trait-precise-capturing.rs rustdoc: normalise type/field names in rustdoc-json-types/jsondoclint 2024-09-01 23:58:08 +03:00
keyword_private.rs Remove rustc::existing_doc_keyword lint. 2024-12-17 13:56:10 +11:00
keyword.rs Remove rustc::existing_doc_keyword lint. 2024-12-17 13:56:10 +11:00
nested.rs rustdoc: normalise type/field names in rustdoc-json-types/jsondoclint 2024-09-01 23:58:08 +03:00
non_lifetime_binders.rs rustdoc: normalise type/field names in rustdoc-json-types/jsondoclint 2024-09-01 23:58:08 +03:00
output_generics.rs Update all rustdoc-json/ tests to use the new style 2024-07-19 16:54:42 +02:00
pub_mod_in_private_mod.rs rustdoc: fixed #101105 2024-08-08 17:13:15 +01:00
return_private.rs Made Path::name only have item name rather than full name 2025-01-14 06:03:43 +00:00
stripped_modules.rs Update all rustdoc-json/ tests to use the new style 2024-07-19 16:54:42 +02:00
the_smallest.rs rustdoc-json: discard non-local inherent impls 2024-08-05 11:19:22 +01:00
trait_alias.rs rustdoc: normalise type/field names in rustdoc-json-types/jsondoclint 2024-09-01 23:58:08 +03:00
type_alias.rs rustdoc: normalise type/field names in rustdoc-json-types/jsondoclint 2024-09-01 23:58:08 +03:00