summary refs log tree commit diff
path: root/src/librustdoc/clean/inline.rs
AgeCommit message (Collapse)AuthorLines
2022-10-31rustdoc: add support for incoherent impls on structs and traitsMichael Howell-0/+15
Fixes #103170
2022-10-29Auto merge of #102233 - petrochenkov:effvis, r=jackh726bors-2/+2
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.
2022-10-26privacy: Rename "accessibility levels" to "effective visibilities"Vadim Petrochenkov-2/+2
And a couple of other naming tweaks Related to https://github.com/rust-lang/rust/issues/48054
2022-10-25Don't merge inline doc comments for impl blocksGuillaume Gomez-8/+35
2022-10-09ImplItemKind::TyAlias => ImplItemKind::TypeMichael Goulet-1/+1
2022-09-27rustdoc: remove `clean::TraitWithExtraInfo`Michael Howell-4/+0
Instead, it gathers the extra info later, when it's actually requested.
2022-09-01Auto merge of #100869 - nnethercote:replace-ThinVec, r=spastorinobors-2/+3
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`
2022-08-29Replace `rustc_data_structures::thin_vec::ThinVec` with `thin_vec::ThinVec`.Nicholas Nethercote-2/+3
`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.
2022-08-28Remove Attrs type aliasGuillaume Gomez-8/+6
2022-08-25Fix missing cfg propagation for reexportsGuillaume Gomez-1/+1
2022-08-16rustdoc: box ItemKind::TraitMichael Howell-1/+1
This reduces the memory consumption of ItemKind.
2022-08-16rustdoc: factor Type::QPath out into its own boxMichael Howell-1/+1
This reduces the size of Type.
2022-08-10remove Clean trait implementation for ty::AssocItemGuillaume Gomez-5/+6
2022-08-10Rollup merge of #100319 - GuillaumeGomez:rm-clean-impls-2, r=Dylan-DPCMatthias Krüger-4/+4
Remove more Clean trait implementations Follow-up of https://github.com/rust-lang/rust/pull/99638. r? ``@Dylan-DPC``
2022-08-08remove Clean trait implementation for hir::GenericsGuillaume Gomez-3/+3
2022-08-08remove Clean trait implementation for hir::ImplItemGuillaume Gomez-2/+2
2022-08-06rustdoc: do not mark the contents of a skipped module as inlinedMichael Howell-5/+32
2022-08-02Rollup merge of #100057 - GuillaumeGomez:rm-more-clean-impl, r=Dylan-DPCMatthias Krüger-4/+4
Remove more Clean trait implementations Follow-up of https://github.com/rust-lang/rust/pull/99638. r? ``@notriddle``
2022-08-02Rollup merge of #100005 - GuillaumeGomez:cleanup-ast-attr-clean, r=notriddleMatthias Krüger-3/+3
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`
2022-08-02Remove Clean trait implementation for ast::Attribute and cleanup ↵Guillaume Gomez-3/+3
Attributes::from_ast function by splitting it in two
2022-08-02Remove Clean trait implementation for ty::TraitRefGuillaume Gomez-4/+4
2022-08-01Remove visibility from AssocItem.Camille GILLOT-1/+1
2022-07-30Remove Clean trait implementation for ty::VariantDefGuillaume Gomez-3/+3
2022-07-29Box FunctionItem, TyMethodItem, MethodItem, ForeignFunctionItemest31-2/+2
This reduces ItemKind size from 160 bytes to 112 bytes
2022-07-29Box TypedefItem, ImplItem, AssocTypeItem variants of ItemKindest31-5/+5
This reduces ItemKind size from 224 bytes to 160 bytes.
2022-07-29Remove box syntax from Box<rustdoc::clean::types::ItemKind> constructionest31-2/+2
The type has 240 bytes according to compiler internal rustdoc.
2022-07-28Remove Clean trait implementation for ty::VisibilityGuillaume Gomez-3/+4
2022-07-24Remove Clean trait implementation for FieldDefGuillaume Gomez-4/+4
2022-07-23Remove Clean trait implementation for hir::Ty and middle::TyGuillaume Gomez-7/+7
2022-07-22Make some clean::Trait fields computation on demandGuillaume Gomez-8/+1
2022-07-17rustdoc: extend `#[doc(tuple_variadic)]` to fn pointersMichael Howell-2/+2
The attribute is also renamed `fake_variadic`.
2022-07-11Remove box syntax for Box<Attributes> constructionest31-4/+10
Attributes only has 48 bytes according to compiler internal rustdoc.
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