about summary refs log tree commit diff
path: root/src/librustdoc/clean
AgeCommit message (Collapse)AuthorLines
2022-10-10Rollup merge of #102831 - compiler-errors:rustdoc-norm-oops, r=jyn514Yuki Okushi-5/+4
Don't use unnormalized type in `Ty::fn_sig` call in rustdoc `clean_middle_ty` Self-explanatory Fixes #102828
2022-10-10Rollup merge of #102829 - compiler-errors:rename-impl-item-kind, r=TaKO8KiYuki Okushi-2/+2
rename `ImplItemKind::TyAlias` to `ImplItemKind::Type` The naming of this variant seems inconsistent given that this is not really a "type alias", and the associated type variant for `TraitItemKind` is just called `Type`.
2022-10-09Remove unnecessary lift calls from rustdocMichael Goulet-18/+9
2022-10-09Don't use unnormalized type in Ty::fn_sigMichael Goulet-5/+4
2022-10-09ImplItemKind::TyAlias => ImplItemKind::TypeMichael Goulet-2/+2
2022-10-07Change InferCtxtBuilder from enter to buildCameron Steffen-64/+57
2022-10-05rustdoc: render more cross-crate hrtbs properlyLeón Orell Valerian Liehr-33/+90
2022-10-03Rollup merge of #102439 - fmease:rustdoc-simplify-cross-crate-trait-bounds, ↵Matthias Krüger-23/+25
r=GuillaumeGomez rustdoc: re-sugar more cross-crate trait bounds Previously, we would only ever re-sugar cross-crate predicates like `Type: Trait, <Type as Trait>::Name == Rhs` to `Type: Trait<Name = Rhs>` if the `Type` was a generic parameter like `Self` or `T`. With this PR, `Type` can be any type. Most notably, this means that we now re-sugar predicates involving associated types (where `Type` is of the form `Self::Name`) which are then picked up by the pre-existing logic that re-sugars them into bounds. As a result of that, the associated type `IntoIter` of `std`'s `IntoIterator` trait (re-exported from `core`) is no longer rendered as: ```rust type IntoIter: Iterator where <Self::IntoIter as Iterator>::Item == Self::Item; ``` but as one would expect: `type IntoIter: Iterator<Item = Self::Item>;`. Cross-crate closure bounds like `F: Fn(i32) -> bool` are now also rendered properly (previously, the return type (`Self::Output`) would not be rendered and we would show the underlying equality predicate). Fixes #77763. Fixes #84579. Fixes #102142. `@rustbot` label T-rustdoc A-cross-crate-reexports r? rustdoc
2022-10-03rustdoc: re-sugar more cross-crate trait boundsLeón Orell Valerian Liehr-23/+25
2022-09-29Auto merge of #101887 - nnethercote:shrink-Res, r=spastorinobors-6/+11
Shrink `hir::def::Res` r? `@spastorino`
2022-09-29Shrink `hir::def::Res`.Nicholas Nethercote-6/+11
`Res::SelfTy` currently has two `Option`s. When the second one is `Some` the first one is never consulted. So we can split it into two variants, `Res::SelfTyParam` and `Res::SelfTyAlias`, reducing the size of `Res` from 24 bytes to 12. This then shrinks `hir::Path` and `hir::PathSegment`, which are the HIR types that take up the most space.
2022-09-28Auto merge of #102384 - camelid:extrainfo, r=GuillaumeGomezbors-12/+4
rustdoc: Remove `clean::TraitWithExtraInfo` and queryify `is_notable_trait` cc `@notriddle` `@GuillaumeGomez`
2022-09-27rustdoc: Queryify `is_notable_trait`Noah Lev-2/+2
This might help with #102375.
2022-09-27rustdoc: remove `clean::TraitWithExtraInfo`Michael Howell-13/+5
Instead, it gathers the extra info later, when it's actually requested.
2022-09-27attributes: Add #[rustc_safe_intrinsic] builtinArthur Cohen-1/+1
2022-09-27rustc_typeck to rustc_hir_analysislcnr-3/+3
2022-09-26remove cfg(bootstrap)Pietro Albini-1/+0
2022-09-24separate definitions and `HIR` ownersTakayuki Maeda-4/+4
fix a ui test use `into` fix clippy ui test fix a run-make-fulldeps test implement `IntoQueryParam<DefId>` for `OwnerId` use `OwnerId` for more queries change the type of `ParentOwnerIterator::Item` to `(OwnerId, OwnerNode)`
2022-09-23rename Unevaluated to UnevaluatedConstb-naber-1/+1
2022-09-22introduce mir::Unevaluatedb-naber-2/+1
2022-09-19remove the `Subst` trait, always use `EarlyBinder`lcnr-2/+1
2022-09-17Auto merge of #98588 - b-naber:valtrees-cleanup, r=lcnrbors-4/+3
Use only ty::Unevaluated<'tcx, ()> in type system r? `@lcnr`
2022-09-15Streamline `register_res`.Nicholas Nethercote-21/+5
Turns out it's only ever passed a `Res::Def`.
2022-09-13rebaseb-naber-1/+1
2022-09-13use ty::Unevaluated<'tcx, ()> in type systemb-naber-3/+2
2022-09-12Plumb dyn trait representation through ty::DynamicEric Holk-1/+1
2022-09-10Auto merge of #98559 - jackh726:remove-reempty, r=oli-obkbors-9/+0
Remove ReEmpty r? rust-lang/types
2022-09-10Rollup merge of #101631 - rust-lang:notriddle/duplicate-module, r=GuillaumeGomezDylan DPC-5/+14
rustdoc: avoid cleaning modules with duplicate names Fixes #83375
2022-09-10Rustdoc-Json: Correcty handle intra-doc-links to items without HTML pageNixon Enraght-Moony-2/+5
Closes #101531
2022-09-09rustdoc: when removing duplicate names, ignore `#[doc(hidden)]` itemsMichael Howell-3/+10
2022-09-09rustdoc: avoid cleaning modules with duplicate namesMichael Howell-3/+5
2022-09-09Handle generic parameters.Camille GILLOT-11/+1
2022-09-09Rustdoc supportMichael Goulet-0/+10
2022-09-09RPITIT placeholder itemsMichael Goulet-2/+2
2022-09-08Remove ReEmptyJack Huey-9/+0
2022-09-08Auto merge of #101467 - nnethercote:shrink-hir-Ty-Pat, r=spastorinobors-3/+3
Shrink `hir::Ty` and `hir::Pat` r? `@ghost`
2022-09-08Rollup merge of #101498 - petrochenkov:visparam, r=cjgillotDylan DPC-3/+3
rustc: Parameterize `ty::Visibility` over used ID It allows using `LocalDefId` instead of `DefId` when possible, and also encode cheaper `Visibility<DefIndex>` into metadata.
2022-09-08Arena-allocate `hir::Lifetime`.Nicholas Nethercote-3/+3
This shrinks `hir::Ty` from 72 to 48 bytes. `visit_lifetime` is added to the HIR stats collector because these types are now stored in memory on their own, instead of being within other types.
2022-09-07Use niche-filling optimization even when multiple variants have data.Michael Benfield-1/+2
Fixes #46213
2022-09-07Auto merge of #101432 - nnethercote:shrink-PredicateS, r=lcnrbors-3/+3
Shrink `PredicateS` r? `@ghost`
2022-09-07rustc: Parameterize `ty::Visibility` over used IDVadim Petrochenkov-3/+3
It allows using `LocalDefId` instead of `DefId` when possible, and also encode cheaper `Visibility<DefIndex>` into metadata.
2022-09-05Pack `Term` in the same way as `GenericArg`.Nicholas Nethercote-3/+3
This shrinks the `PredicateS` type, which is instanted frequently.
2022-09-04rustdoc: Compute enum discriminant on demandNixon Enraght-Moony-16/+18
2022-09-03Rustdoc-Json: Add enum discriminantNixon Enraght-Moony-15/+56
2022-09-01Auto merge of #100869 - nnethercote:replace-ThinVec, r=spastorinobors-28/+26
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-30rustdoc: Resugar async fn return type in `clean`, not `html`Nixon Enraght-Moony-1/+4
This way it also happens for json output. Fixes #101199
2022-08-29Rollup merge of #99821 - cjgillot:ast-lifetimes-2, r=compiler-errorsDylan DPC-1/+1
Remove separate indexing of early-bound regions ~Based on https://github.com/rust-lang/rust/pull/99728.~ This PR copies some modifications from https://github.com/rust-lang/rust/pull/97839 around object lifetime defaults. These modifications allow to stop counting generic parameters during lifetime resolution, and rely on the indexing given by `rustc_typeck::collect`.
2022-08-29Replace `rustc_data_structures::thin_vec::ThinVec` with `thin_vec::ThinVec`.Nicholas Nethercote-28/+26
`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-29Rollup merge of #101116 - GuillaumeGomez:rm-attrs-ty-alias, r=notriddleMatthias Krüger-8/+6
[rustdoc] Remove Attrs type alias When working on https://github.com/rust-lang/rust/pull/101006, I was quite confused because of this type alias as I'm used to having rustdoc types into `clean/types.rs`. Anyway, considering how few uses of it we have, I simply removed it. r? `````@notriddle`````
2022-08-28Auto merge of #100497 - kadiwa4:remove_clone_into_iter, r=cjgillotbors-2/+2
Avoid cloning a collection only to iterate over it `@rustbot` label: +C-cleanup