summary refs log tree commit diff
path: root/src/librustdoc/clean/inline.rs
AgeCommit message (Collapse)AuthorLines
2022-08-08rustdoc: do not mark the contents of a skipped module as inlinedMichael Howell-5/+32
2022-06-11Fix incorrectly spelled "variadic"Michael Howell-1/+1
2022-06-08rustdoc: show tuple impls as `impl Trait for (T, ...)`Michael Howell-1/+5
This commit adds a new unstable attribute, `#[doc(tuple_varadic)]`, that shows a 1-tuple as `(T, ...)` instead of just `(T,)`, and links to a section in the tuple primitive docs that talks about these.
2022-05-24Rollup merge of #97288 - compiler-errors:tcxify-rustdoc, r=Dylan-DPCDylan DPC-1/+1
Lifetime variance fixes for rustdoc #97287 migrates rustc to a `Ty` type that is invariant over its lifetime `'tcx`, so I need to fix a bunch of places that assume that `Ty<'a>` and `Ty<'b>` can be unified by shortening both to some common lifetime. This is doable, since everything is already `'tcx`, so all this PR does is be a bit more explicit that elided lifetimes are actually `'tcx`. Split out from #97287 so the rustdoc team can review independently.
2022-05-23Auto merge of #94053 - GuillaumeGomez:fields-stripped, r=notriddlebors-3/+1
rustdoc: Remove fields_stripped fields (and equivalents) Fixes #90588. r? `@camelid`
2022-05-23Auto merge of #97195 - notriddle:notriddle/cleanup, r=GuillaumeGomezbors-1/+1
rustdoc: shrink GenericArgs/PathSegment with boxed slices This PR also contains a few cleanup bits and pieces, but one of them is a broken intra-doc link, and the other is removing an unused Hash impl. The last commit is the one that matters.
2022-05-22Lifetime variance fixes for rustdocMichael Goulet-1/+1
2022-05-22Auto merge of #97177 - oli-obk:const-stability, r=davidtwcobors-2/+2
Implement proper stability check for const impl Trait, fall back to unstable const when undeclared Continuation of #93960 `@jhpratt` it looks to me like the test was simply not testing for the failure you were looking for? Your checks actually do the right thing for const traits?
2022-05-21Shrink GenericArgs/PathSegment with boxed slicesMichael Howell-1/+1
2022-05-21Remove fields_stripped fields (and equivalents)Guillaume Gomez-3/+1
2022-05-21Remove `crate` visibility modifier in libs, testsJacob Pratt-9/+9
2022-05-19Add and use stability helper methodsJacob Pratt-2/+2
This avoids an ambiguity (when reading) where `.level.is_stable()` is not immediately clear whether it is general stability or const stability.
2022-05-10update rustdoclcnr-3/+3
2022-04-16Rename `def_id` into `item_id` when the type is `ItemId` for readabilityGuillaume Gomez-1/+1
2022-04-12rustdoc: discr. required+provided assoc consts+tysLeón Orell Valerian Liehr-1/+1
2022-04-07Hide cross-crate doc-hidden assoc items in trait implsLeón Orell Valerian Liehr-4/+17
2022-03-29Remember mutability in `DefKind::Static`.Camille GILLOT-1/+1
This allows to compute the `BodyOwnerKind` from `DefKind` only, and removes a direct dependency of some MIR queries onto HIR. As a side effect, it also simplifies metadata, since we don't need 4 flavours of `EntryKind::*Static` any more.
2022-03-29Remove header field from clean::FunctionGuillaume Gomez-8/+1
2022-03-12Remove needless use of `Into`Noah Lev-2/+2
2022-03-11Improve `AdtDef` interning.Nicholas Nethercote-1/+1
This commit makes `AdtDef` use `Interned`. Much the commit is tedious changes to introduce getter functions. The interesting changes are in `compiler/rustc_middle/src/ty/adt.rs`.
2022-03-04Auto merge of #94009 - compiler-errors:gat-rustdoc, r=GuillaumeGomezbors-1/+1
Support GATs in Rustdoc Implements: 1. Rendering GATs in trait definitions and impl blocks 2. Rendering GATs in types (e.g. in the return type of a function) Fixes #92341 This is my first rustdoc PR, so I have absolutely no idea how to produce tests for this. Advice from the rustdoc team would be wonderful! I tested locally and things looked correct: ![image](https://user-images.githubusercontent.com/3674314/153988325-9732cbf3-0645-4e1a-9e64-ddfd93877b55.png)
2022-03-03make generic projection types print correctlyMichael Goulet-1/+1
2022-03-01Rollup merge of #93385 - CraftSpider:rustdoc-ty-fixes, r=camelidDylan DPC-1/+1
Rustdoc ty consistency fixes Changes to make rustdoc cleaning of ty more consistent with hir, and hopefully use it in more places. r? `@camelid`
2022-02-09Ensure that queries only return Copy types.Camille GILLOT-1/+1
2022-01-26Don't use is_local to determine function cleaning method call intentRune Tynan-1/+1
2022-01-14rustdoc: avoid many `Symbol` to `String` conversions.Nicholas Nethercote-6/+3
Particularly when constructing file paths and fully qualified paths. This avoids a lot of allocations, speeding things up on almost all examples.
2022-01-09Auto merge of #92690 - matthiaskrgr:rollup-rw0oz05, r=matthiaskrgrbors-1/+2
Rollup of 8 pull requests Successful merges: - #92055 (Add release notes for 1.58) - #92490 (Move crate drop-down to search results page) - #92510 (Don't resolve blocks in foreign functions) - #92573 (expand: Refactor InvocationCollector visitor for better code reuse) - #92608 (rustdoc: Introduce a resolver cache for sharing data between early doc link resolution and later passes) - #92657 (Implemented const casts of raw pointers) - #92671 (Make `Atomic*::from_mut` return `&mut Atomic*`) - #92673 (Remove useless collapse toggle on "all items" page) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-01-09rustc_metadata: Rename `item_children(_untracked)` to ↵Vadim Petrochenkov-1/+1
`module_children(_untracked)` And `each_child_of_item` to `for_each_module_child`
2022-01-07rustdoc: Introduce a resolver cache for sharing data between early doc link ↵Vadim Petrochenkov-1/+2
resolution and later passes
2022-01-01Rustdoc: use ThinVec for GenericArgs bindingsJakub Beránek-1/+2
2021-12-23Rustdoc: use `is_doc_hidden` method on more placesJakub Beránek-4/+4
2021-12-18hir: Do not introduce dummy type names for `extern` blocks in def pathsVadim Petrochenkov-3/+3
Use a separate nameless `DefPathData` variant instead
2021-12-03Remove a Clean impl for a tuple (7)Noah Lev-3/+3
2021-12-03Remove a Clean impl for a tuple (3)Noah Lev-10/+13
2021-11-28Take a LocalDefId in expect_*item.Camille GILLOT-7/+4
2021-11-21Auto merge of #90844 - camelid:cleanup-vis, r=jyn514bors-7/+2
rustdoc: Finish transition to computed visibility This finishes the transition to using computed visibility in rustdoc.
2021-11-19Rollup merge of #90750 - camelid:rm-tuple-impls-1, r=jyn514Yuki Okushi-0/+1
rustdoc: Replace where-bounded Clean impl with simple function This is the first step in removing the Clean impls for tuples. Either way, this significantly simplifies the code since it reduces the amount of "trait magic". (To clarify, I'm referring to impls like `impl Clean for (A, B)`, not Clean impls that work on tuples in the user's program.) cc ``@jyn514``
2021-11-17rustdoc: Clean `Visibility` outside of `display_macro_source`Noah Lev-7/+2
This change should make the code a bit clearer and easier to change.
2021-11-09Add comments ensuring that generics are cleaned before argsNoah Lev-0/+1
Otherwise, rustdoc panics with messages like this: thread 'rustc' panicked at 'assertion failed: cx.impl_trait_bounds.is_empty()', src/librustdoc/clean/utils.rs:462:5 This ordering requirement is unrelated to the `clean_fn_decl_with_args` refactoring, but the requirement was uncovered as part of that change. I'm not sure if *all* of these places have the requirement, but I added comments to them just in case.
2021-11-09Add `ty::Visibility::is_public()`inquisitivecrystal-2/+2
2021-11-07Remove Clean impl for `Vec<T>`Noah Lev-6/+4
2021-11-07Remove Clean impl for `IndexVec<T>`Noah Lev-1/+1
2021-11-07Remove Clean impl for `Option<T>`Noah Lev-1/+1
2021-11-07rustdoc: Use `ty::ImplPolarity` instead of custom enumNoah Lev-1/+1
2021-11-07Use an enum to record polarity in `clean::Impl`Noah Lev-1/+1
2021-11-07rustdoc: Refactor `Impl.{synthetic,blanket_impl}` into enumNoah Lev-3/+4
This change has two advantages: 1. It makes the possible states clearer, and it makes it impossible to construct invalid states, such as a blanket impl that is also an auto trait impl. 2. It shrinks the size of `Impl` a bit, since now there is only one field, rather than two.
2021-11-06rustdoc: Remove redundant `Impl.span` fieldNoah Lev-1/+0
It can be computed on-demand in `Item::span()`.
2021-10-27Improve perf measurements of `build_extern_trait_impl`Noah Lev-0/+2
Before, it was only measuring one callsite of `build_impl`, and it incremented the call count even if `build_impl` returned early because the `did` was already inlined. Now, it measures all calls, minus calls that return early.
2021-10-22Fix another place that used `def_id_no_primitives()`Noah Lev-1/+1
2021-10-22Rename `Type::def_id_full()` to `Type::def_id()`Noah Lev-2/+2
It should be preferred over `def_id_no_primitives()`, so it should have a shorter name. I also put it before `def_id_no_primitives()` so that it shows up first in the docs.