| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
It can be computed on-demand in `Item::span()`.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
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
|
|
It is not as large as `Crate.src` was, but it's still 8 bytes, and
`clean::Crate` is moved by-value a lot.
|
|
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.
|
|
|
|
|
|
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.
|
|
rustdoc: Remove `GetDefId`
See the individual commit messages for details.
r? `@jyn514`
|
|
|
|
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
|
|
|
|
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.
|
|
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.
|
|
In general, it should be preferred over `Type::def_id()`. See each
method's docs for more.
|
|
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.
|
|
|
|
It was only used in one place, so it seems better to use ordinary
functions.
|
|
scrape-examples options
|
|
|
|
Based on looking at the source code, it looks like the `did` needs to be
for an impl, not functions in an impl.
|
|
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`
|
|
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.
|
|
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.
|
|
rustdoc: Add static size assertion for `clean::Type`
r? `@jyn514`
|
|
|
|
|
|
|
|
|
|
rustdoc: Cleanup various `clean` types
Cleanup various `clean` types.
|
|
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
|
|
Add tests for module-path remapping and scrape example options
Find all crates with a given name
|
|
* 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
|
|
Improve styling
Start to clean up code, add comments
|
|
Simplify toggle UI logic, add workspace root for URLs
|
|
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
|
|
are not useful
|