Commit Graph

33 Commits

Author SHA1 Message Date
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
Rune Tynan
be4ea06643 Modifiers -> Qualifiers 2021-02-12 23:24:09 -05:00
Rune Tynan
0a91daeaa3 Vec -> HashSet 2021-02-08 16:04:14 -05:00
Rune Tynan
ce02b7f7a6 Add comment + move derive helper 2021-02-08 15:45:50 -05:00
Rune Tynan
a26fa74d3c Make header a vec of modifiers, make FunctionPointer consistent with Function and Method. 2021-02-08 14:00:30 -05:00
Vadim Petrochenkov
dbdbd30bf2 expand/resolve: Turn #[derive] into a regular macro attribute 2021-02-07 20:08:45 +03:00
Rune Tynan
30ecde0beb Add abi field to Method 2021-02-05 22:25:11 -05:00
Rune Tynan
3106de5f2a Remove struct_type from union output and bump format 2021-01-28 23:30:40 -05:00
Rune Tynan
3aa8456c88 Fix README typo 2021-01-28 11:15:43 -05:00
Rune Tynan
67b78a0271 Update crate name and add README 2021-01-27 18:58:44 -05:00
Rune Tynan
3076e255fe src/etc/json-types -> src/rustdoc-json-types 2021-01-27 18:58:43 -05:00