Add abi field to `Method`
Also bumps version and adds a test (Will conflict with #81500, whichever is merged first)
Rationale: It's possible for methods to have an ABI. This should be exposed in the JSON.
Remove struct_type from union output
Also bumps the format number and adds a test
Rationale: It's illegal to have unions of the form `union Union(i32, f32);`, or `union Union;`. The struct_type field was recently removed from the rustdoc Union AST, at which time this field was changed to always just read "union". It makes sense to completely remove it, as it provides no information.
Remove doctree::StructType
Also removes it from the Union type, as unions can only ever be 'Plain'. Adds a new StructType to JSON, 'union', as the easiest way to encode the type of a union there. This leaves only one item in doctree, `Module`.
r? `@jyn514`
This brings the size of `Item` from
```
[src/librustdoc/lib.rs:103] std::mem::size_of::<Item>() = 680
```
to
```
[src/librustdoc/lib.rs:103] std::mem::size_of::<Item>() = 280
```
Remove `DefPath` from `Visibility` and calculate it on demand
Depends on #80090 and should not be merged before. Helps with https://github.com/rust-lang/rust/issues/79103 and https://github.com/rust-lang/rust/issues/76382.
cc https://github.com/rust-lang/rust/pull/80014#issuecomment-746810284 - `@nnethercote` I figured it out! It was simpler than I expected :)
This brings the size of `clean::Visibility` down from 40 bytes to 8.
Note that this does *not* remove `clean::Visibility`, even though it's now basically the same as `ty::Visibility`, because the `Invsible` variant means something different from `Inherited` and I thought it would be be confusing to merge the two. See the new comments on `impl Clean for ty::Visibility` for details.
Continue String to Symbol conversion in rustdoc (2)
Follow-up of #80119.
This is the last one (and I actually expected more conversions but seems like it was the last one remaining...).
r? `@jyn514`
Respond to comments and start adding tests
Fix re-exports and extern-crate
Add expected output tests
Add restricted paths
Format
Fix: associated methods missing in output
Ignore stripped items
Mark stripped items
removing them creates dangling references
Fix tests and update conversions
Don't panic if JSON backend fails to create a file
Fix attribute error in JSON testsuite
Move rustdoc-json to rustdoc/
This way it doesn't have to build rustc twice. Eventually it should
probably get its own suite, like rustdoc-js, but that can be fixed in a
follow-up.
Small cleanups
Don't prettify json before printing
This fully halves the size of the emitted JSON.
Add comments
[BREAKING CHANGE] rename version -> crate_version
[BREAKING CHANGE] rename source -> span
Use exhaustive matches
Don't qualify imports for DefId
Rename clean::{ItemEnum -> ItemKind}, clean::Item::{inner -> kind}
Fix Visibility conversion
clean::Visability was changed here:
https://github.com/rust-lang/rust/pull/77820/files#diff-df9f90aae0b7769e1eb6ea6f1d73c1c3f649e1ac48a20e169662a8930eb427beL1467-R1509
More churn catchup
Format