summary refs log tree commit diff
path: root/src/librustdoc/clean/inline.rs
AgeCommit message (Collapse)AuthorLines
2021-06-02Restrict access to crate_name.Camille GILLOT-1/+1
Also remove original_crate_name, which had the exact same implementation
2021-06-01Revert "Reduce the amount of untracked state in TyCtxt"Camille Gillot-1/+1
2021-05-30Restrict access to crate_name.Camille GILLOT-1/+1
Also remove original_crate_name, which had the exact same implementation
2021-05-19rustdoc: render `<Self as X>::Y` type casts properlyJustus K-0/+1
2021-05-07Rollup merge of #84442 - jyn514:doc-cfg, r=petrochenkovDylan DPC-2/+2
Unify rustc and rustdoc parsing of `cfg()` This extracts a new `parse_cfg` function that's used between both. - Treat `#[doc(cfg(x), cfg(y))]` the same as `#[doc(cfg(x)] #[doc(cfg(y))]`. Previously it would be completely ignored. - Treat `#[doc(inline, cfg(x))]` the same as `#[doc(inline)] #[doc(cfg(x))]`. Previously, the cfg would be ignored. - Pass the cfg predicate through to rustc_expand to be validated Technically this is a breaking change, but doc_cfg is still nightly so I don't think it matters. Fixes https://github.com/rust-lang/rust/issues/84437. r? `````````@petrochenkov`````````
2021-05-04Add type to differentiate between fake and real DefId'sJustus K-4/+4
2021-05-03Unify rustc and rustdoc parsing of `cfg()`Joshua Nelson-2/+2
This extracts a new `parse_cfg` function that's used between both. - Treat `#[doc(cfg(x), cfg(y))]` the same as `#[doc(cfg(x)] #[doc(cfg(y))]`. Previously it would be completely ignored. - Treat `#[doc(inline, cfg(x))]` the same as `#[doc(inline)] #[doc(cfg(x))]`. Previously, the cfg would be ignored. - Pass the cfg predicate through to rustc_expand to be validated Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
2021-05-03Rollup merge of #84832 - Stupremee:dont-print-vis-in-external-traits, r=jyn514Dylan DPC-3/+13
Do not print visibility in external traits This PR fixes the bug that caused traits, which were re-exported, having visibility modifiers in front of methods, which is invalid. It would be nice to add a test for this, but I don't even know if tests with multiple crates are possible. Resolves #81274
2021-05-03Rollup merge of #84811 - scottmcm:rustdoc-trait-alias-fix, r=jyn514Dylan DPC-1/+1
RustDoc: Fix bounds linking trait.Foo instead of traitalias.Foo Fixes #84782 The code was assuming `Trait` when adding bounds to the cache, so add a check on the DefId to see what its kind really is. r? `@jyn514` Before: ![image](https://user-images.githubusercontent.com/18526288/116775611-6a751e80-aa53-11eb-84d0-ed6b7782be3c.png) After: ![image](https://user-images.githubusercontent.com/18526288/116802227-d19cdc80-ab00-11eb-8133-7b34dd750da2.png)
2021-05-02Do not print visibility in external traitsJustus K-3/+13
2021-05-01RustDoc: Fix bounds linking trait.Foo instead of traitalias.FooScott McMurray-1/+1
2021-04-30Remove unnecessary `provided_trait_methods` field from ImplJoshua Nelson-8/+1
It can be calculated on-demand.
2021-04-27Auto merge of #84494 - tdelabro:84304-bis, r=jyn514bors-19/+28
84304 - rustdoc: shrink Item::Attributes Helps with https://github.com/rust-lang/rust/issues/84304
2021-04-27cfg taken out of Attributes, put in ItemTimothée Delabrouille-18/+28
check item.is_fake() instead of self_id.is_some() Remove empty branching in Attributes::from_ast diverse small refacto after Josha review cfg computation moved in merge_attrs refacto use from_ast twice for coherence take cfg out of Attributes and move it to Item
2021-04-27Removed usage of Attributes in FnDecl and ExternalCrate. Relocate part of ↵Timothée Delabrouille-2/+1
the fields in Attributes, as functions in AttributesExt. refacto use from_def_id_and_attrs_and_parts instead of an old trick most of josha suggestions + check if def_id is not fake before using it in a query Removed usage of Attributes in FnDecl and ExternalCrate. Relocate part of the Attributes fields as functions in AttributesExt.
2021-04-25get rid of min_const_fn references in library/ and rustdocRalf Jung-2/+1
2021-04-24Get rid of `item.span`Joshua Nelson-3/+3
- Remove `span` field, adding `Item::span()` instead - Special-case `Impl` and `Module` items - Use dummy spans for primitive items
2021-04-24Do the hard part firstJoshua Nelson-1/+2
The only bit failing was the module, so change that before removing the `span` field.
2021-04-25Rollup merge of #84464 - jyn514:type-kind, r=CraftSpiderYuki Okushi-16/+16
rustdoc: Get rid of `clean::TypeKind` It does exactly the same thing as ItemType.
2021-04-23Take ItemType instead of TypeKind in record_extern_fqnJoshua Nelson-16/+16
2021-04-23rustdoc: Remove unnecessary `is_crate` field from doctree::Module and ↵Joshua Nelson-1/+1
clean::Module It can be calculated on-demand even without a TyCtxt. This also changed `from_item_kind` to take a whole item, which avoids having to add more and more parameters.
2021-04-02rustdoc: Rename internal uses of `spotlight`Camelid-1/+1
I didn't make these renames in #80965 because I didn't want the PR to conflict with #80914.
2021-04-02Auto merge of #80965 - camelid:rename-doc-spotlight, r=jyn514bors-1/+1
Rename `#[doc(spotlight)]` to `#[doc(notable_trait)]` Fixes #80936. "spotlight" is not a very specific or self-explaining name. Additionally, the dialog that it triggers is called "Notable traits". So, "notable trait" is a better name. * Rename `#[doc(spotlight)]` to `#[doc(notable_trait)]` * Rename `#![feature(doc_spotlight)]` to `#![feature(doc_notable_trait)]` * Update documentation * Improve documentation r? `@Manishearth`
2021-03-24Split clean::Constant enum into a struct and an enumGuillaume Gomez-1/+4
2021-03-24Rename clean::Constant did fields to def_idGuillaume Gomez-2/+2
2021-03-24Improve new Constant variants' nameGuillaume Gomez-1/+1
2021-03-24Rework rustdoc const typeGuillaume Gomez-13/+6
2021-03-21Rename `clean::Item.source` to `span`Camelid-1/+1
Its type is called `clean::Span`, and also the name in the rest of rustdoc and rustc for this kind of field is `span`.
2021-03-15Rename `#[doc(spotlight)]` to `#[doc(notable_trait)]`Camelid-1/+1
"spotlight" is not a very specific or self-explaining name. Additionally, the dialog that it triggers is called "Notable traits". So, "notable trait" is a better name. * Rename `#[doc(spotlight)]` to `#[doc(notable_trait)]` * Rename `#![feature(doc_spotlight)]` to `#![feature(doc_notable_trait)]` * Update documentation * Improve documentation
2021-03-01Remove the dummy cache in `DocContext`Joshua Nelson-6/+7
The same information is available everywhere; the only reason the dummy cache was needed is because it waas previously stored in three different places. This consolidates the info a bit so the cache in `DocContext` is used throughout. As a bonus, it means `renderinfo` is used much much less. - Return a `Cache` from `run_global_ctxt`, not `RenderInfo` - Remove the unused `render_info` from `run_renderer` - Remove RefCell around `inlined` - Add intra-doc links
2021-02-25Auto merge of #82265 - GuillaumeGomez:cleanup-attrs-twice, r=jyn514bors-5/+6
Prevent to compute Item attributes twice I came across this case when working on another part of rustdoc. Not a game changer but a nice little improvement. cc `@camelid` r? `@jyn514`
2021-02-24Prevent to compute Item attributes twiceGuillaume Gomez-5/+6
2021-02-23Improve code readabilityGuillaume Gomez-7/+5
2021-02-23Put clean::Trait extra information into a new struct to make it more coherentGuillaume Gomez-3/+7
2021-02-23Remove is_spotlight field from `Trait`Guillaume Gomez-3/+3
2021-02-22Remove many RefCells from DocContextCamelid-11/+10
I left some of them so this change doesn't balloon in size and because removing the RefCell in `DocContext.resolver` would require compiler changes. Thanks to `@jyn514` for making this a lot easier with #82020!
2021-02-16Make `Clean` take &mut DocContextJoshua Nelson-18/+22
- Take `FnMut` in `rustc_trait_selection::find_auto_trait_generics` - Take `&mut DocContext` in most of `clean` - Collect the iterator in auto_trait_impls instead of iterating lazily; the lifetimes were really bad. - Changes `fn sess` to properly return a borrow with the lifetime of `'tcx`, not the mutable borrow.
2021-02-11clean up clean::Static structGuillaume Gomez-1/+1
2021-02-05Remove Function all_types and ret_types fieldsGuillaume Gomez-3/+0
2021-01-30rustdoc tweakingbors-15/+10
* Reuse memory * simplify `next_def_id`, avoid multiple hashing and unnecessary lookups * remove `all_fake_def_ids`, use the global map instead (probably not a good step toward parallelization, though...) * convert `add_deref_target` to iterative implementation * use `ArrayVec` where we know the max number of elements * minor touchups here and there * avoid building temporary vectors that get appended to other vectors At most places I may or may not be doing the compiler's job is this PR.
2021-01-20Remove StructType entirely and replace it with CtorKindRune Tynan-7/+3
2021-01-20Move StructType to clean, remove it from Unions, make JSON output whether ↵Rune Tynan-6/+4
something is a union
2021-01-14Auto merge of #80802 - jyn514:box-attributes, r=nnethercotebors-3/+3
Box Item::Attributes This reduces the size of Item from 128 to 40 bytes. I think this is as small as it needs to get :tada: Builds on https://github.com/rust-lang/rust/pull/80339 and should not be merged before. r? `@GuillaumeGomez`
2021-01-12Separate out a `hir::Impl` structJoshua Nelson-9/+11
This makes it possible to pass the `Impl` directly to functions, instead of having to pass each of the many fields one at a time. It also simplifies matches in many cases.
2021-01-10Box Item::attributesJoshua Nelson-3/+3
This reduces the size of Item from 136 to 48 bytes.
2021-01-10Auto merge of #80867 - JohnTitor:rollup-tvqw555, r=JohnTitorbors-50/+41
Rollup of 9 pull requests Successful merges: - #79502 (Implement From<char> for u64 and u128.) - #79968 (Improve core::ptr::drop_in_place debuginfo) - #80774 (Fix safety comment) - #80801 (Use correct span for structured suggestion) - #80803 (Remove useless `fill_in` function) - #80820 (Support `download-ci-llvm` on NixOS) - #80825 (Remove under-used ImplPolarity enum) - #80850 (Allow #[rustc_builtin_macro = "name"]) - #80857 (Add comment to `Vec::truncate` explaining `>` vs `>=`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-01-10Rollup merge of #80825 - GuillaumeGomez:rustdoc-cleanup-bis-repetita, r=jyn514Yuki Okushi-1/+1
Remove under-used ImplPolarity enum It doesn't make much sense to have an enum with only two possible values and to store it inside an `Option` in my opinion when you can do all the same with a simple boolean. I don't expect any chances, performance or RSS usage wise. r? ``@jyn514``
2021-01-09Replace under-used ImplPolarity enum with a booleanGuillaume Gomez-1/+1
2021-01-07Remove useless `fill_in` functionJoshua Nelson-49/+40
It was only used once, in a function that was otherwise trivial.
2021-01-06Style nit: avoid confusing name shadowing in pattern matchDaniel Henry-Mantilla-2/+2
Co-authored-by: Joshua Nelson <joshua@yottadb.com>