about summary refs log tree commit diff
path: root/src/librustdoc/clean
AgeCommit message (Collapse)AuthorLines
2021-11-07Remove Clean impl for `&T`Noah Lev-7/+1
2021-11-07Remove unused Clean impl for `Rc<T>`Noah Lev-7/+0
2021-11-07Remove Clean impl for `Vec<T>`Noah Lev-49/+47
2021-11-07Remove Clean impl for `IndexVec<T>`Noah Lev-8/+1
2021-11-07Remove Clean impl for `Option<T>`Noah Lev-11/+5
2021-11-07rustdoc: Use `ty::ImplPolarity` instead of custom enumNoah Lev-25/+6
2021-11-07Use an enum to record polarity in `clean::Impl`Noah Lev-13/+20
2021-11-07rustdoc: Refactor `Impl.{synthetic,blanket_impl}` into enumNoah Lev-13/+46
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-11/+13
It can be computed on-demand in `Item::span()`.
2021-11-07Give inline const separate DefKindGary Guo-2/+3
2021-11-05rustdoc: clippy::complexity fixesMatthias Krüger-4/+3
2021-11-02Split doc_cfg and doc_auto_cfg featuresGuillaume Gomez-3/+6
2021-10-31Merge `DocContext.{ty,lt,ct}_substs` into one mapNoah Lev-10/+38
It should be impossible to have more than one entry with a particular key across the three maps, so they should be one map. In addition to making it impossible for multiple entries to exist, this should improve memory usage since now only one map is allocated on the stack and heap.
2021-10-31Reduce rightward driftNoah Lev-78/+74
2021-10-31Extract function for expanding private type aliasesNoah Lev-91/+98
2021-10-30rustdoc: Stop sorting external cratesNoah Lev-2/+1
Now that #73423 is fixed, sorting should no longer be necessary. See also this discussion [1]. [1]: https://github.com/rust-lang/rust/pull/86889#discussion_r664134963
2021-10-30rustdoc: Remove `Crate.name` and instead compute it on-demandNoah Lev-3/+4
It is not as large as `Crate.src` was, but it's still 8 bytes, and `clean::Crate` is moved by-value a lot.
2021-10-30rustdoc: Remove `Crate.src` and instead compute it on-demandNoah Lev-4/+7
It is only used in one place; `src` was about a third of `Crate`'s total size; `Crate` is frequently moved by-value; and `src` can be easily computed on-demand.
2021-10-30rustdoc: Document that `Crate` is always localNoah Lev-0/+3
2021-10-29rustdoc: Add static size assertion for `clean::Crate`Noah Lev-0/+4
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-27Rollup merge of #90154 - camelid:remove-getdefid, r=jyn514Matthias Krüger-65/+32
rustdoc: Remove `GetDefId` See the individual commit messages for details. r? `@jyn514`
2021-10-25Fix clippy lints in librustdocGuillaume Gomez-59/+55
2021-10-23Rollup merge of #85833 - willcrichton:example-analyzer, r=jyn514Matthias Krüger-1/+2
Scrape code examples from examples/ directory for Rustdoc Adds support for the functionality described in https://github.com/rust-lang/rfcs/pull/3123 Matching changes to Cargo are here: https://github.com/rust-lang/cargo/pull/9525 Live demo here: https://willcrichton.net/example-analyzer/warp/trait.Filter.html#method.and
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-16/+16
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.
2021-10-22Rename `Type::def_id()` to `Type::def_id_no_primitives()`Noah Lev-3/+7
The old name was confusing because it's easy to assume that using `def_id()` is fine, but in some situations it's incorrect. In general, `def_id_full()` should be preferred, so `def_id_full()` should have a shorter name. That will happen in the next commit.
2021-10-22Use `def_id_full()` where easily possibleNoah Lev-4/+4
In general, it should be preferred over `Type::def_id()`. See each method's docs for more.
2021-10-22Replace `GetDefId` with inherent methodsNoah Lev-25/+15
Now that it's only implemented for `Type`, using inherent methods instead means that imports are no longer necessary. Also, `GetDefId` is only meant to be used with `Type`, so it shouldn't be a trait.
2021-10-22Remove unused impl of `GetDefId` for `Option<T>`Noah Lev-10/+0
2021-10-22Remove `GetDefId` impl for `FnRetTy`Noah Lev-11/+4
It was only used in one place, so it seems better to use ordinary functions.
2021-10-22Revert def_id addition from clean::Function, add test forWill Crichton-9/+2
scrape-examples options
2021-10-21Remove unused impl of `GetDefId` for `Typedef`Noah Lev-10/+0
2021-10-21Fix docs for `inline::build_impl`Noah Lev-1/+1
Based on looking at the source code, it looks like the `did` needs to be for an impl, not functions in an impl.
2021-10-21Auto merge of #89998 - camelid:box-default, r=jyn514bors-11/+15
rustdoc: Box some fields of `GenericParamDefKind` to reduce size This change shrinks `GenericParamDef` from 120 to 56 bytes. `GenericParamDef` is used a lot, so the extra indirection should hopefully be worth the size savings. r? `@ghost`
2021-10-18rustdoc: Box `ty` field of `GenericParamDefKind::Const`Noah Lev-5/+5
This cuts the size of `GenericParamDef` in half, from 104 bytes to 56 bytes. I think the extra indirection should be worth the size savings.
2021-10-18rustdoc: Box `default` fields of `GenericParamDefKind`Noah Lev-8/+8
This reduces the size of `GenericParamDef` a bit, but some of the size savings are hidden because of the `ty` field of the `Const` variant. I will box that in the next commit.
2021-10-18Rollup merge of #89989 - camelid:type-size, r=jyn514Matthias Krüger-0/+4
rustdoc: Add static size assertion for `clean::Type` r? `@jyn514`
2021-10-17Add static size assertion for `clean::GenericParamDef`Noah Lev-0/+4
2021-10-17Add static size assertion for `clean::Type`Noah Lev-0/+4
2021-10-17Some "parenthesis" and "parentheses" fixesr00ster91-1/+1
2021-10-10Fix spelling: Cannonical -> CanonicalJohn Kugelman-1/+1
2021-10-09Auto merge of #88379 - camelid:cleanup-clean, r=jyn514bors-362/+279
rustdoc: Cleanup various `clean` types Cleanup various `clean` types.
2021-10-08Auto merge of #89576 - tom7980:issue-89275-fix, r=estebankbors-1/+2
Prevent error reporting from outputting a recursion error if it finds an ambiguous trait impl during suggestions Closes #89275 This fixes the compiler reporting a recursion error during another already in progress error by trying to make a conversion method suggestion and encounters ambiguous trait implementations that can convert a the original type into a type that can then be recursively converted into itself via another method in the trait. Updated OverflowError struct to be an enum so I could differentiate between passes - it's no longer a ZST but I don't think that should be a problem as they only generate when there's an error in compiling code anyway
2021-10-06Add target crates as inputs to reduce size of intermediatesWill Crichton-14/+15
Add tests for module-path remapping and scrape example options Find all crates with a given name
2021-10-06Incorporate jyn's feedbackWill Crichton-29/+12
* Move call location logic from function constructor to rendering * Fix issue with macro spans in scraping examples * Clean up example loading logic Documentation / newtype for DecorationInfo Fix line number display Serialize edition of call site, other small cleanup
2021-10-06Sort examples by sizeWill Crichton-0/+2
Improve styling Start to clean up code, add comments
2021-10-06Factor scraping and rendering into separate calls to rustdocWill Crichton-3/+3
Simplify toggle UI logic, add workspace root for URLs
2021-10-06Add updated support for example-analyzerWill Crichton-16/+38
Move rendering of examples into Finalize design Cleanup, rename found -> scraped Softer yellow Clean up dead code Document scrape_examples More simplification and documentation Remove extra css Test
2021-10-06Simplify AttributesExt::cfg function and remove error emissions since they ↵Guillaume Gomez-27/+10
are not useful