Commit graph

51 commits

Author SHA1 Message Date
Guillaume Gomez
5adca7305e Add regression test for json reexport bug 2022-06-02 11:14:33 +02:00
Martin Nordholts
774b525f6f rustdoc-json: Add tests for all three HRTB fields 2022-05-04 21:03:01 +02:00
Nixon Enraght-Moony
26829c03b0 rustdoc-json: Lifetime tests 2022-03-15 18:34:16 +00:00
Nixon Enraght-Moony
42b548cf9d rustdoc-json: Add tests for generic fn args and returns 2022-03-15 18:34:16 +00:00
Nixon Enraght-Moony
4a57399ab0 rustdoc-json: Add test for supertraits 2022-03-15 18:23:07 +00: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
Nixon Enraght-Moony
a424f42e97 rustdoc-json: Make the fns/generics.rs test much more robust 2022-03-04 05:54:12 +01: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
0e57a16c88 add tests 2022-03-03 13:01:35 -08:00
Nixon Enraght-Moony
fd5adefce1 rustdoc-json: Add tests for fn qualifiers and ABI 2022-02-18 23:48:41 +00:00
Nixon Enraght-Moony
bf0e862903 rustdoc-json: Add some tests for typealias item 2022-02-09 16:10:58 +00:00
Rune Tynan
92206318bc Add has tests for blanket_with_local trait methods 2022-01-22 19:55:25 -05:00
Rune Tynan
66d056a9bf Update test to include self case 2022-01-21 13:19:18 -05:00
Matthias Krüger
6cdd2e510c
Rollup merge of #93094 - Enselic:check-for-enum-tuple-struct-fields, r=CraftSpider
src/test/rustdoc-json: Check for `struct_field`s in `variant_tuple_struct.rs`

The presence of `struct_field`s is being checked for already in
`variant_struct.rs`. We should also check for them in `variant_tuple_struct.rs`.

This PR is one small step towards resolving #92945.
2022-01-20 23:37:37 +01:00
Martin Nordholts
ab239cc749 src/test/rustdoc-json: Check for struct_fields in variant_tuple_struct.rs
The presence of `struct_field`s is being checked for already in
`variant_struct.rs`. We should also check for them in `variant_tuple_struct.rs`.
2022-01-19 22:10:26 +01:00
Rune Tynan
74f0e582be Fix typo in test 2022-01-13 13:25:11 -05:00
Rune Tynan
aa523a9b4b Fix errors on blanket impls by ignoring the children of their generated implementations 2022-01-13 12:40:07 -05:00
Guillaume Gomez
1e6ced3532 Create rustdoc_internals feature gate 2021-11-24 21:57:18 +01:00
Loïc BRANSTETT
e252274fb1 Add regression test for #89852 2021-10-14 02:12:18 +02:00
Loïc BRANSTETT
4891aaf2e9 Remove special-casing of never primitive in rustdoc-json-types 2021-10-08 16:53:39 +02:00
Manish Goregaokar
7a09755148
Rollup merge of #88234 - hkmatsumoto:rustdoc-impls-for-primitive, r=jyn514
rustdoc-json: Don't ignore impls for primitive types

Fix the issue discussed at [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/.E2.9C.94.20Json.20output.20lacks.20some.20item.20which.20are.20supposed.20to.20be.20there)

r? ``@jyn514``
2021-10-04 23:56:16 -07:00
Hirochika Matsumoto
e18a8efb8b Don't ignore impls for primitive types 2021-09-29 23:57:01 +09:00
Loïc BRANSTETT
88ff75c6cc Fix populate of union.impls 2021-09-26 18:22:07 +02: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
Guillaume Gomez
a5213888e0 Add rustdonc-json tests for enum variants 2021-08-29 16:00:48 +02:00
Nixon Enraght-Moony
d9e2d8d665 Rename span to source
Caused by
b0659f9b1b (diff-ede26372490522288745c5b3df2b6b2a1cc913dcd09b29af3a49935afe00c7e6L464-R464)
2021-03-24 19:44:23 +00:00
Nixon Enraght-Moony
9ba92972ed Don't call item on modules for json renderer
Closes #80664
2021-03-24 16:54:13 +00:00
Camelid
99ff2767bf Update tests
These tests were added to master after I made my changes.
2021-03-21 19:48:51 -07: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
Yuki Okushi
a98dc9b3e7
Rollup merge of #82571 - aDotInTheVoid:reexport-tests, r=CraftSpider
Rustdoc Json: Add tests for Reexports, and improve jsondocck

The two changes are orthognal, so you can land just one if you want, but the improved errors realy helped write the tests.

Notably does not have the case from #80664, but I want to have all the ajacent cases tested before starting work on that to ensure I dont break anything.

Improves #81359

cc ```@CraftSpider```

r? ```@jyn514```

```@rustbot``` modify labels: +A-testsuite +T-rustdoc +A-rustdoc-json
2021-03-12 08:55:13 +09:00
Nixon Enraght-Moony
9925ecb392 Add reexport tests 2021-03-10 22:06:05 +00:00
Joshua Nelson
be069a687a Remove krate.version; fix crate_version in JSON
Previously, `JsonRenderer::after_krate` called `krate.version.clone()`.
The problem was it did that after the version was already moved into the
cache, so it would always be None. The fix was to get the version from
the cache instead.
2021-03-01 00:30:40 -05:00
Nixon Enraght-Moony
dd4b938c7f Implement using @set values 2021-02-20 01:50:12 +00:00
Nixon Enraght-Moony
cd5f603c31 Implement @set 2021-02-20 01:25:09 +00:00
Nixon Enraght-Moony
a00eb7ee1d Add @is command to jsondocck 2021-02-20 00:43:02 +00: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
Rune Tynan
30ecde0beb
Add abi field to Method 2021-02-05 22:25:11 -05:00
Mara Bos
e98e42b881
Rollup merge of #81500 - CraftSpider:union-kind, r=jyn514
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.
2021-02-05 12:25:59 +01:00
Rune Tynan
3106de5f2a
Remove struct_type from union output and bump format 2021-01-28 23:30:40 -05:00
Rune Tynan
1c60d27a52
Remove leading newline 2021-01-28 23:24:13 -05:00
Rune Tynan
a2f5c72a2d
Fix has_body for trait methods 2021-01-28 23:24:12 -05:00
Rune Tynan
728ffc8c03
Address review v2 2021-01-19 17:02:34 -05:00
Rune Tynan
7715656edd
Add jsondocck tool, and use it for rustdoc JSON 2021-01-19 14:24:25 -05:00
Rune Tynan
31b17f513b
Add warning to compare.py about error messages 2021-01-15 12:50:05 -05:00
Rune Tynan
e42c1b9c2a
Fix JSON test 2021-01-15 12:50:04 -05:00
Nixon Enraght-Moony
c254a15906 Use true ID for def_id. 2020-12-05 22:38:57 +00:00
Nixon Enraght-Moony
d619271f2b Normalize windows path seperators. 2020-12-02 21:24:42 +00:00
Nixon Enraght-Moony
40b5470b0d Address review comments.
Go back to CRATE_DEF_INDEX

Minor niceness improvements

Don't output hidden items

Remove striped items from fields

Add $TEST_BASE_DIR

Small catch
2020-12-01 18:34:39 +00:00