| Age | Commit message (Collapse) | Author | Lines |
|
|
|
rustdoc: use `ThinVec` and `Box<str>` to shrink `clean::ItemKind`
|
|
|
|
|
|
cross-crate functions and methods
|
|
|
|
Make rustdoc Item::visibility computed on-demand
This is a take-over of https://github.com/rust-lang/rust/pull/91408.
Helps with https://github.com/rust-lang/rust/issues/90852 (needs to use `ty::Visibility` directly too).
cc `@camelid`
r? `@notriddle`
|
|
r=GuillaumeGomez
rustdoc: add support for incoherent impls on structs and traits
Fixes #103170
|
|
|
|
Fixes #103170
|
|
rustdoc for external def-ids
|
|
privacy: Rename "accessibility levels" to "effective visibilities"
And a couple of other naming and comment tweaks.
Related to https://github.com/rust-lang/rust/issues/48054
For `enum Level` I initially used naming `enum EffectiveVisibilityLevel`, but it was too long and inconvenient because it's used pretty often.
So I shortened it to just `Level`, if it needs to be used from some context where this name would be ambiguous, then it can be imported with renaming like `use rustc_middle::privacy::Level as EffVisLevel` or something.
|
|
And a couple of other naming tweaks
Related to https://github.com/rust-lang/rust/issues/48054
|
|
|
|
|
|
Instead, it gathers the extra info later, when it's actually requested.
|
|
Replace `rustc_data_structures::thin_vec::ThinVec` with `thin_vec::ThinVec`
`rustc_data_structures::thin_vec::ThinVec` looks like this:
```
pub struct ThinVec<T>(Option<Box<Vec<T>>>);
```
It's just a zero word if the vector is empty, but requires two
allocations if it is non-empty. So it's only usable in cases where the
vector is empty most of the time.
This commit removes it in favour of `thin_vec::ThinVec`, which is also
word-sized, but stores the length and capacity in the same allocation as
the elements. It's good in a wider variety of situation, e.g. in enum
variants where the vector is usually/always non-empty.
The commit also:
- Sorts some `Cargo.toml` dependency lists, to make additions easier.
- Sorts some `use` item lists, to make additions easier.
- Changes `clean_trait_ref_with_bindings` to take a
`ThinVec<TypeBinding>` rather than a `&[TypeBinding]`, because this
avoid some unnecessary allocations.
r? `@spastorino`
|
|
`rustc_data_structures::thin_vec::ThinVec` looks like this:
```
pub struct ThinVec<T>(Option<Box<Vec<T>>>);
```
It's just a zero word if the vector is empty, but requires two
allocations if it is non-empty. So it's only usable in cases where the
vector is empty most of the time.
This commit removes it in favour of `thin_vec::ThinVec`, which is also
word-sized, but stores the length and capacity in the same allocation as
the elements. It's good in a wider variety of situation, e.g. in enum
variants where the vector is usually/always non-empty.
The commit also:
- Sorts some `Cargo.toml` dependency lists, to make additions easier.
- Sorts some `use` item lists, to make additions easier.
- Changes `clean_trait_ref_with_bindings` to take a
`ThinVec<TypeBinding>` rather than a `&[TypeBinding]`, because this
avoid some unnecessary allocations.
|
|
|
|
|
|
This reduces the memory consumption of ItemKind.
|
|
This reduces the size of Type.
|
|
|
|
Remove more Clean trait implementations
Follow-up of https://github.com/rust-lang/rust/pull/99638.
r? ``@Dylan-DPC``
|
|
|
|
|
|
|
|
Remove more Clean trait implementations
Follow-up of https://github.com/rust-lang/rust/pull/99638.
r? ``@notriddle``
|
|
Remove Clean trait for ast::Attribute and improve Attributes::from_ast
I prefer to keep this commit on its own for this PR because I'm changing a bit more things than expected originally: I split `Attributes::from_ast` into two because there is only one location making use of its second parameter.
Follow-up of https://github.com/rust-lang/rust/pull/99638.
r? `@notriddle`
|
|
Attributes::from_ast function by splitting it in two
|
|
|
|
|
|
|
|
This reduces ItemKind size from 160 bytes to 112 bytes
|
|
This reduces ItemKind size from 224 bytes to 160 bytes.
|
|
The type has 240 bytes according to compiler internal rustdoc.
|
|
|
|
|
|
|
|
|
|
The attribute is also renamed `fake_variadic`.
|
|
Attributes only has 48 bytes according to compiler internal rustdoc.
|
|
|
|
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.
|
|
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.
|
|
rustdoc: Remove fields_stripped fields (and equivalents)
Fixes #90588.
r? `@camelid`
|
|
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.
|
|
|
|
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?
|
|
|