Commit graph

64 commits

Author SHA1 Message Date
Nixon Enraght-Moony
dacffd22a0 Rustdoc-Json: Clean up tests 2022-07-18 16:59:11 +01:00
Guillaume Gomez
b95b1389c5 Add tests for JSON non-inlining 2022-07-16 13:39:38 +02:00
Martin Nordholts
ba87c934ea rustdoc-json: Make default value of blanket impl assoc types work 2022-06-29 21:05:51 +02:00
Matthias Krüger
956a9f55c0
Rollup merge of #98611 - GuillaumeGomez:rustdoc-json-glob-ice, r=notriddle
Fix glob import ICE in rustdoc JSON format

Fixes #98003.

r? `@notriddle`
2022-06-28 18:34:32 +02:00
Guillaume Gomez
c2221eff62 Add regression test for glob import ICE in rustdoc JSON 2022-06-28 11:46:24 +02:00
Martin Nordholts
2888e76d06 test/rustdoc-json/assoc_type.rs: Maximize chance of detecting future ICEs 2022-06-28 11:02:14 +02:00
Martin Nordholts
ae4b929c00 rustdoc-json: Add assoc type ICE regression test 2022-06-28 10:10:40 +02:00
Guillaume Gomez
9277f959dd Add test for associated items in rustdoc JSON 2022-06-27 16:01:13 +02:00
Guillaume Gomez
75ad2f7a76 Add test for keywords in rustdoc JSON output 2022-06-22 16:26:22 +02:00
Yuki Okushi
4557ff7bd7
Rollup merge of #98195 - GuillaumeGomez:rustdoc-json-primitive, r=notriddle
Fix rustdoc json primitive handling

Fixes https://github.com/rust-lang/rust/issues/98006.

cc `@matthiaskrgr`
2022-06-18 10:03:25 +09:00
Guillaume Gomez
7cdf126a3a Add regression test for #98006 2022-06-17 15:48:53 +02:00
Guillaume Gomez
d7513140ca Add rustdonc-json regression test for #98009 2022-06-16 14:13:57 +02:00
Guillaume Gomez
99cd9cae10 Add regression test for #97986 2022-06-13 15:29:29 +02:00
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