Guillaume Gomez
1ae875f0a3
Improve code readability
2023-02-18 18:28:17 +01:00
Guillaume Gomez
3adc081254
Fix bad handling of primitive types
2023-02-18 18:28:17 +01:00
Guillaume Gomez
0541a0c8c3
Allow reexports of items with same name but different types to both appear
2023-02-18 18:13:23 +01:00
Guillaume Gomez
86fd5a1b44
Use more let chain
2023-02-15 12:00:03 +01:00
Guillaume Gomez
cc8758480c
Fix small debug typo
2023-02-08 17:31:54 +01:00
Vadim Petrochenkov
68803926e0
rustdoc: Use DefId(Map,Set) instead of FxHash(Map,Set)
...
Not all uses are converted, a few cases iterating through maps/sets and requiring nontrivial changes are kept.
2023-01-22 02:12:05 +04:00
Nixon Enraght-Moony
881bd865ad
Rustdoc-Json: Don't include foreign traits
2022-12-02 16:58:10 +00:00
Vadim Petrochenkov
b32a4edb20
rustc_ast_lowering: Stop lowering imports into multiple items
...
Lower them into a single item with multiple resolutions instead.
This also allows to remove additional `NodId`s and `DefId`s related to those additional items.
2022-12-01 18:51:20 +03: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
Michael Howell
a63a03dc54
rustdoc: remove clean::TraitWithExtraInfo
...
Instead, it gathers the extra info later, when it's actually requested.
2022-09-27 12:27:04 -07:00
Nixon Enraght-Moony
aac7429c17
Rustdoc-Json: List impls for primitives
...
Closes #101695
2022-09-26 18:06:48 +01:00
Nixon Enraght-Moony
e80ccd3d3a
Rustdoc-Json: Don't loose subitems of foreign traits.
2022-09-13 18:34:15 +01:00
Matthias Krüger
ecd908ac5e
Rollup merge of #101106 - aDotInTheVoid:rdj-stripped-mod, r=GuillaumeGomez
...
Rustdoc-Json: Retain Stripped Modules when they are imported, not when they have items
Fixes #101103
Fixes #100973
r? `@GuillaumeGomez`
2022-08-29 21:12:56 +02:00
Nixon Enraght-Moony
8050c1993b
Rustdoc-Json: Retain Stripped Modules when they are imported, not when they have items.
...
Fixes #101103
Fixes #100973
2022-08-29 00:15:10 +01:00
bors
ce36e88256
Auto merge of #100497 - kadiwa4:remove_clone_into_iter, r=cjgillot
...
Avoid cloning a collection only to iterate over it
`@rustbot` label: +C-cleanup
2022-08-28 18:31:08 +00:00
Martin Nordholts
dbeb506eae
rustdoc JSON: Fix ICE with pub extern crate self as <self_crate_name>
2022-08-16 15:54:50 +02:00
KaDiWa
4eebcb9910
avoid cloning and then iterating
2022-08-13 16:16:52 +02:00
Guillaume Gomez
1a15c7147f
Fix rustdoc JSON inline
2022-07-16 13:39:38 +02:00
Guillaume Gomez
87d90b1332
Fix rustdoc handling of primitive documentation
2022-06-17 14:41:07 +02:00
Guillaume Gomez
a752f82f19
Ignore impl items because they can be duplicated in case of generic impl
2022-06-13 15:29:29 +02:00
Guillaume Gomez
77e729ea92
Add Symbol into rustdoc JSON ID to prevent conflicts between reexports
2022-06-02 11:14:32 +02:00
Jacob Pratt
6970246886
Remove crate visibility modifier in libs, tests
2022-05-21 00:32:47 -04:00
Guillaume Gomez
b1e6211c5c
Rename def_id into item_id when the type is ItemId for readability
2022-04-16 14:28:09 +02:00
Nixon Enraght-Moony
a5c0b1470c
rustdoc-json-types: implementors -> implementations
...
Closes #94198
2022-03-14 00:05:11 +00:00
Nixon Enraght-Moony
ae158224ac
rustdoc-json: buffer output
2022-02-13 01:25:54 +00:00
Rune Tynan
f4b42946c8
Remove FIXME and fix inconsistency of local blanket impls by using HIR for them
2022-01-21 13:01:58 -05:00
Matthias Krüger
51fd48f157
Rollup merge of #93099 - tomkris:rustdoc-fix, r=jsha
...
rustdoc: auto create output directory when "--output-format json"
This PR allows rustdoc to automatically create output directory in case it does not exist (when run with `--output-format json`).
This fixes rustdoc crash:
````
$ rustdoc --output-format json -Z unstable-options src/main.rs
error: couldn't generate documentation: No such file or directory (os error 2)
|
= note: failed to create or modify "doc/main.json"
error: aborting due to previous error
````
With this fix behavior of `rustdoc --output-format json` becomes consistent with `rustdoc --output-format html` (which already auto-creates output directory if it's missing)
2022-01-20 23:37:39 +01:00
Matthias Krüger
530c884372
Rollup merge of #92860 - CraftSpider:rustdoc-json-impl-ice, r=jsha
...
Fix errors on blanket impls by ignoring the children of generated impls
Related to #83718
We can safely skip the children, as they don't contain any new info, and may be subtly different for reasons hard to track down, in ways that are consistently worse than the actual generic impl.
2022-01-20 23:37:31 +01:00
Artem Kryvokrysenko
4e17170c54
rustdoc: auto create output directory when "--output-format json"
...
This PR allows rustdoc to automatically create output directory in case
it does not exist (when run with `--output-format json`).
This fixes rustdoc crash:
````
$ rustdoc --output-format json -Z unstable-options src/main.rs
error: couldn't generate documentation: No such file or directory (os error 2)
|
= note: failed to create or modify "doc/main.json"
error: aborting due to previous error
````
With this fix behavior of `rustdoc --output-format json` becomes consistent
with `rustdoc --output-format html` (which already auto-creates output
directory if it's missing)
2022-01-19 22:28:07 -08:00
Nicholas Nethercote
10b1c9aa8b
rustdoc: avoid many Symbol to String conversions.
...
Particularly when constructing file paths and fully qualified paths.
This avoids a lot of allocations, speeding things up on almost all
examples.
2022-01-14 11:57:18 -08:00
Rune Tynan
474e091160
Move FIXME to if statement
2022-01-13 14:46:04 -05:00
Rune Tynan
aafcbf1e70
Update comment to make it a FIXME
2022-01-13 14:43:32 -05:00
Rune Tynan
a6aa3cb2c1
inline ItemId method, clarify comments a bit
2022-01-13 14:40:28 -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
bors
65d8785f0a
Auto merge of #92377 - compiler-errors:rustdoc-lifetimes, r=camelid,jyn514
...
remove in_band_lifetimes from librustdoc
r? `@camelid`
closes #92368
2021-12-30 08:26:07 +00:00
Michael Goulet
bc7968f961
remove in_band_lifetimes from librustdoc
2021-12-28 18:18:00 -08:00
Noah Lev
2b801dcdd3
Move ExternalLocation to clean::types
...
It was previously defined in `render::search_index` but wasn't used at
all there. `clean::types` seems like a better fit since that's where
`ExternalCrate` is defined.
2021-12-27 18:57:07 -08:00
Noah Lev
60a1abe4c5
Rename rustdoc::html::render::cache to search_index
...
The old name wasn't very clear, while the new one makes it clear that
this is the code responsible for creating the search index.
2021-12-27 18:42:13 -08:00
Yuval Dolev
43f4ef5c6a
Moved format-version constant to rustdoc-json-types
2021-10-15 12:27:42 +03:00
Guillaume Gomez
4adc8ea2ac
Rollup merge of #89669 - Urgau:json-remove-type-never, r=GuillaumeGomez
...
Remove special-casing of never primitive in rustdoc-json-types
Fixes https://github.com/rust-lang/rust/issues/89349
r? `@GuillaumeGomez`
2021-10-08 22:30:42 +02:00
Matthias Krüger
e6f77a1787
clippy::complexity fixes
2021-10-08 20:07:44 +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
Justus K
97c82d8731
Revert "rustdoc: Store DefId's in ItemId on heap for decreasing Item's size"
...
This reverts commit 41a345d4c46dad1a98c9993bc78513415994e8ba.
2021-07-05 19:51:54 +02:00
Justus K
45d3daece3
rustdoc: Store DefId's in ItemId on heap for decreasing Item's size
2021-07-05 19:51:51 +02:00
Justus K
acd4dc2d0c
rustdoc: Rename expect_real to expect_def_id, remove Item::is_fake
2021-07-05 19:49:48 +02:00