Commit Graph

60 Commits

Author SHA1 Message Date
Luca Palmieri
cd7688bd30 Verify that ItemEnum can be serialized and then deserialized using bincode 2023-05-22 18:26:20 +01:00
Luca Palmieri
a5e5101375 Serialize all enums as externally tagged to guarantee compatibility with binary formats such as bincode or postcard 2023-05-22 18:22:08 +01:00
León Orell Valerian Liehr
61e1eda6db
IAT: Rustdoc integration 2023-05-04 16:59:11 +02:00
DaniPopes
f470c29936
Fix remaining typos 2023-04-10 21:02:49 +02:00
ozkanonur
52c71e6e28 fix inconsistent json outputs from rustdoc
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-03-05 00:09:09 +03:00
Nixon Enraght-Moony
cca5d219e6 Rustdoc-Json: Report discriminant on all kinds of enum variant.
Closes #106299
2023-01-01 19:48:26 +00:00
Matthias Krüger
091f5e1a6c
Rollup merge of #103065 - aDotInTheVoid:rdj-arg-pattern, r=GuillaumeGomez
rustdoc-json: Document and Test that args can be patterns.
2022-11-30 19:53:17 +01:00
Martin Nordholts
30b7e44a3c rustdoc JSON: Clarify that Function is also used for methods 2022-11-20 13:48:49 +01:00
Martin Nordholts
8b5bfaf662 rustdoc JSON: Use Function everywhere and remove Method 2022-11-16 20:24:03 +01:00
cui fliter
442f848d74 fix some typos in comments
Signed-off-by: cui fliter <imcusg@gmail.com>
2022-11-13 15:26:17 +08:00
Nixon Enraght-Moony
064ad83cc3 rustdoc-json-types: Improve ItemSummary::path docs 2022-10-28 10:25:48 +01:00
Nixon Enraght-Moony
bb04e7e2a2 rustdoc-json: Document and Test that args can be patterns. 2022-10-14 19:57:01 +01:00
Nixon Enraght-Moony
aac7429c17 Rustdoc-Json: List impls for primitives
Closes #101695
2022-09-26 18:06:48 +01:00
Nixon Enraght-Moony
cb6c923cf4 Document that ResolvedPath can also be a union 2022-09-16 19:51:58 +01:00
Nixon Enraght-Moony
fdf7ec8694 Rustdoc-Json: Fix Type docs.
Primitive doesn't include Array/Slice/Tuple, as they are their own
variants.

ResolvedPath doesn't include Traits, as they appear in the DynTrait
variant.
2022-09-12 14:56:04 +01:00
Nixon Enraght-Moony
1c8de17323 Rustdoc-Json: More accurate struct type.
Closes #101489
2022-09-07 09:42:23 +01:00
Nixon Enraght-Moony
065e0b9c9c Rustdoc-Json: Store Variant Fields as their own item.
Closes #100587
Closes #92945
2022-09-05 23:59:33 +01:00
Nixon Enraght-Moony
b76a012be1 Rustdoc-Json: Add enum discriminant 2022-09-03 22:15:26 +01:00
Michael Goulet
4989f6a724
Rollup merge of #100335 - aDotInTheVoid:rdj-resolved-path, r=GuillaumeGomez
Rustdoc-Json: Add `Path` type for traits.

Avoids using `Type` for trait fields, as a trait must always be a path, and not any other kind of type.

``@rustbot`` modify labels: +A-rustdoc-json +T-rustdoc

Closes #100106
2022-08-13 21:06:48 -07:00
Nixon Enraght-Moony
86bdb3ed09 Rustdoc-Json: Add Path type for traits.
Closes #100106
2022-08-10 10:21:52 +01:00
Matthias Krüger
0dc39c7bd9
Rollup merge of #99479 - Enselic:import-can-be-without-id, r=camelid
rustdoc-json: Remove doc FIXME for Import::id and explain

Also add some test and refactor related code a bit.

``@rustbot`` labels +A-rustdoc-json +T-rustdoc
2022-08-10 00:00:24 +02:00
Nixon Enraght-Moony
a856e57f6c Rustdoc-Json: Document HRTB's on DynTrait
Closes #99118
2022-08-03 14:17:26 +01:00
Martin Nordholts
1b6f6296e9 rustdoc-json: Remove doc FIXME for Import::id and explain 2022-07-19 22:43:39 +02:00
Guillaume Gomez
1a15c7147f Fix rustdoc JSON inline 2022-07-16 13:39:38 +02:00
Nixon Enraght-Moony
18aea4594b rustdoc-json-types: Clean up derives.
Closes #96189

Closes #96189

Everything is `Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize`
except `Crate` and `Item` which arn't `Hash`, as they have `HashMap`'s.
See linked issue for reasoning.
2022-07-02 00:11:29 +01:00
Martin Nordholts
1f15ce5f97 rustdoc-json: Fix HRTBs for WherePredicate::BoundPredicate 2022-05-04 21:03:01 +02:00
Martin Nordholts
b712135575 rustdoc-json-types: Improve docs for HRTB fields 2022-05-04 21:03:01 +02:00
Nixon Enraght-Moony
a5c0b1470c rustdoc-json-types: implementors -> implementations
Closes #94198
2022-03-14 00:05:11 +00:00
Nixon Enraght-Moony
b526d8f27c rustdoc-json-types: ty -> type_
Fixes #94889
2022-03-13 23:13:57 +00:00
Martin Nordholts
aa763fcf42 rustdoc-json: Include GenericParamDefKind::Type::synthetic in JSON
The rustdoc JSON for

```
pub fn f(_: impl Clone) {}
```

will effectively be

```
pub fn f<impl Clone: Clone>(_: impl Clone)
```

where a synthetic generic parameter called `impl Clone` with generic
trait bound `Clone` is added to the function declaration.

The generated HTML filters out these generic parameters by doing
`self.params.iter().filter(|p| !p.is_synthetic_type_param())`, because
the synthetic generic parameter is not of interest to regular users.

For the same reason, we should expose whether or not a generic parameter
is synthetic or not also in the rustdoc JSON, so that rustdoc JSON
clients can also have the option to hide synthetic generic parameters.
2022-03-04 05:54:12 +01:00
Michael Goulet
aefc0a223a make generic projection types print correctly 2022-03-03 13:01:35 -08:00
Michael Goulet
ca6e06efba make GATs print properly in traits 2022-02-27 21:36:29 -08:00
Nixon Enraght-Moony
aa601574a5 rustdoc-json: Better Header Type
- Make ABI an enum, instead of being stringly typed
- Replace Qualifier HashSet with 3 bools
- Merge ABI field into header, as they always occor together
2022-02-18 23:31:33 +00:00
Loïc BRANSTETT
1521b53c53 Increase the format version of rustdoc-json-types 2022-01-20 22:14:02 +01:00
kadmin
e7529d6a38 Update term for use in more places
Replace use of `ty()` on term and use it in more places. This will allow more flexibility in the
future, but slightly worried it allows items which are consts which only accept types.
2022-01-17 19:59:40 +00:00
Yuval Dolev
43f4ef5c6a Moved format-version constant to rustdoc-json-types 2021-10-15 12:27:42 +03:00
Loïc BRANSTETT
4891aaf2e9 Remove special-casing of never primitive in rustdoc-json-types 2021-10-08 16:53:39 +02:00
Hirochika Matsumoto
e18a8efb8b Don't ignore impls for primitive types 2021-09-29 23:57:01 +09:00
Mark Rousskov
c746be2219 Migrate to 2021 2021-09-20 22:21:42 -04:00
Noah Lev
2a60229490 rustdoc: Clean up handling of lifetime bounds
Previously, rustdoc recorded lifetime bounds by rendering them into the
name of the lifetime parameter. Now, it leaves the name as the actual
name and instead records lifetime bounds in an `outlives` list, similar
to how type parameter bounds are recorded.
2021-09-02 14:27:59 -07:00
Jade
3cf820e17d rfc3052: Remove authors field from Cargo manifests
Since RFC 3052 soft deprecated the authors field anyway, hiding it from
crates.io, docs.rs, and making Cargo not add it by default, and it is
not generally up to date/useful information, we should remove it from
crates in this repo.
2021-07-29 14:56:05 -07:00
kadmin
417b098cfc Add generic arg infer 2021-07-25 07:28:51 +00:00
Ellen
6dff51f37d rustdoc- Show defaults on const generics 2021-06-03 09:01:25 +01:00
Camelid
b0659f9b1b rustdoc-json: Rename Import.span to Import.source
* It is called `source` in rustc and the rest of rustdoc
* It is not a span, rather it is the source of the import
2021-03-21 19:47:12 -07:00
Camelid
e190983bd3 Rename rustdoc_json_types::Item.source to span 2021-03-21 19:47:12 -07:00
Rune Tynan
70c9b370e8
x.py fmt 2021-03-06 15:50:29 -05:00
Rune Tynan
83cece468e
Move tests to own file 2021-03-06 15:50:29 -05:00
Rune Tynan
ca48d1566e
Add roundtrip testing and bump format version 2021-03-06 15:50:28 -05:00
Rune Tynan
cf5246915b
Remove Item::kind, use tagged enum. Rename variants to match 2021-03-06 15:50:20 -05:00
Dylan DPC
641c3785dc
Rollup merge of #81891 - CraftSpider:fn-header, r=jyn514
[rustdoc-json] Make `header` a vec of modifiers, and FunctionPointer consistent

Bumps version number and adds tests, this is a breaking change. I can split this into two (`is_unsafe` -> `header` and `header: Vec<Modifiers>`) if desired.

Rationale: Modifiers are individual notes on a function, it makes more sense for them to be a list of an independent enum over a String which is inconsistently exposing the HIR representation (prefix_str vs custom literals).
Function pointers currently only support `unsafe`, but there has been talk on and off about allowing them to also support `const`, and this makes handling their modifiers consistent with handling those of a function, allowing better shared code.

`@rustbot` modify labels: +A-rustdoc-json +T-rustdoc
CC: `@HeroicKatora`
r? `@jyn514`
2021-02-14 16:54:45 +01:00