summary refs log tree commit diff
path: root/src/librustdoc/clean
AgeCommit message (Collapse)AuthorLines
2022-08-08Synthetize a trait ref when none is available.Camille GILLOT-6/+12
2022-08-08Avoid ICE in rustdoc.Camille GILLOT-5/+7
2022-08-08rustdoc: do not mark the contents of a skipped module as inlinedMichael Howell-21/+43
2022-08-05rustdoc: avoid inlining foreigns with duplicate namesMichael Howell-5/+7
2022-08-05rustdoc: avoid inlining modules with duplicate namesMichael Howell-2/+5
Fixes rust-lang/rust#99734
2022-07-21Rollup merge of #99344 - ↵Dylan DPC-5/+37
notriddle:notriddle/multiple-macro-rules-w-same-name, r=GuillaumeGomez rustdoc: avoid inlining items with duplicate `(type, name)` Fixes #99221
2022-07-09rustdoc: filter '_ lifetimes from ty::PolyTraitRefMichael Howell-1/+1
Fixes #98697
2022-06-22Auto merge of #98279 - cjgillot:all-fresh-nofn, r=petrochenkovbors-32/+35
Create elided lifetime parameters for function-like types Split from https://github.com/rust-lang/rust/pull/97720 This PR refactor lifetime generic parameters in bare function types and parenthesized traits to introduce the additional required lifetimes as fresh parameters in a `for<>` bound. This PR does the same to lifetimes appearing in closure signatures, and as-if introducing `for<>` bounds on closures (without the associated change in semantics). r? `@petrochenkov`
2022-06-21Rustdoc fallout.Camille GILLOT-32/+35
2022-06-19Rollup merge of #98165 - WaffleLapkin:once_things_renamings, r=m-ou-seMatthias Krüger-1/+1
once cell renamings This PR does the renamings proposed in https://github.com/rust-lang/rust/issues/74465#issuecomment-1153703128 - Move/rename `lazy::{OnceCell, Lazy}` to `cell::{OnceCell, LazyCell}` - Move/rename `lazy::{SyncOnceCell, SyncLazy}` to `sync::{OnceLock, LazyLock}` (I used `Lazy...` instead of `...Lazy` as it seems to be more consistent, easier to pronounce, etc) ```@rustbot``` label +T-libs-api -T-libs
2022-06-16Move/rename `lazy::Sync{OnceCell,Lazy}` to `sync::{Once,Lazy}Lock`Maybe Waffle-1/+1
2022-06-16Auto merge of #97842 - notriddle:notriddle/tuple-docs, r=jsha,GuillaumeGomezbors-6/+19
Improve the tuple and unit trait docs * Reduce duplicate impls; show only the `(T,)` and include a sentence saying that there exists ones up to twelve of them. * Show `Copy` and `Clone`. * Show auto traits like `Send` and `Sync`, and blanket impls like `Any`. Here's the new version: * <https://notriddle.com/notriddle-rustdoc-test/std/primitive.tuple.html> * <https://notriddle.com/notriddle-rustdoc-test/std/primitive.unit.html>
2022-06-16Auto merge of #98108 - SpriteOvO:doc_auto_cfg-feature-rmv-fix, ↵bors-6/+10
r=notriddle,GuillaumeGomez Rustdoc: Fix stab disappearing and exclude cfg "doc" and "doctest" Fixes #98065 Context: https://github.com/rust-lang/rust/issues/43781#issuecomment-1154226733 r? `@GuillaumeGomez`
2022-06-16Fix `cfg(not)` and `cfg(all)` causing Rustdoc stab to disappearSprite-6/+10
2022-06-14address reviewb-naber-9/+10
2022-06-14implement valtrees as the type-system representation for constant valuesb-naber-7/+6
2022-06-14Rename the `ConstS::val` field as `kind`.Nicholas Nethercote-2/+2
And likewise for the `Const::val` method. Because its type is called `ConstKind`. Also `val` is a confusing name because `ConstKind` is an enum with seven variants, one of which is called `Value`. Also, this gives consistency with `TyS` and `PredicateS` which have `kind` fields. The commit also renames a few `Const` variables from `val` to `c`, to avoid confusion with the `ConstKind::Value` variant.
2022-06-11Fix incorrectly spelled "variadic"Michael Howell-3/+3
2022-06-08rustdoc: fixed messed-up rustdoc auto trait implsMichael Howell-4/+4
Before: impl<T, U> UnwindSafe for (T, ...) where T: UnwindSafe, U: UnwindSafe, After: impl<T> UnwindSafe for (T, ...) where T: UnwindSafe,
2022-06-08rustdoc: show tuple impls as `impl Trait for (T, ...)`Michael Howell-2/+15
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-06-08Folding revamp.Nicholas Nethercote-1/+1
This commit makes type folding more like the way chalk does it. Currently, `TypeFoldable` has `fold_with` and `super_fold_with` methods. - `fold_with` is the standard entry point, and defaults to calling `super_fold_with`. - `super_fold_with` does the actual work of traversing a type. - For a few types of interest (`Ty`, `Region`, etc.) `fold_with` instead calls into a `TypeFolder`, which can then call back into `super_fold_with`. With the new approach, `TypeFoldable` has `fold_with` and `TypeSuperFoldable` has `super_fold_with`. - `fold_with` is still the standard entry point, *and* it does the actual work of traversing a type, for all types except types of interest. - `super_fold_with` is only implemented for the types of interest. Benefits of the new model. - I find it easier to understand. The distinction between types of interest and other types is clearer, and `super_fold_with` doesn't exist for most types. - With the current model is easy to get confused and implement a `super_fold_with` method that should be left defaulted. (Some of the precursor commits fixed such cases.) - With the current model it's easy to call `super_fold_with` within `TypeFolder` impls where `fold_with` should be called. The new approach makes this mistake impossible, and this commit fixes a number of such cases. - It's potentially faster, because it avoids the `fold_with` -> `super_fold_with` call in all cases except types of interest. A lot of the time the compile would inline those away, but not necessarily always.
2022-06-03Manipulate lifetimes by LocalDefId for region resolution.Camille GILLOT-17/+6
2022-05-31rustdoc: also index impl traitMichael Howell-0/+4
2022-05-29Auto merge of #96652 - notriddle:notriddle/self, r=GuillaumeGomezbors-0/+6
rustdoc: include impl generics / self in search index Fixes #92205
2022-05-26Rollup merge of #97066 - petrochenkov:nofragkind, r=camelidMichael Goulet-1/+1
rustdoc: Remove `ItemFragment(Kind)` And stop using `write!` when rendering URL fragments to avoid impossible errors.
2022-05-25rustdoc: include impl generics / self in search indexMichael Howell-0/+6
2022-05-25Auto merge of #97365 - klensy:rustdoc-vs-clippy, r=notriddlebors-41/+41
rustdoc: fix few clippy lints Fix few clippy lints: second commit - perf ones, first - other ones.
2022-05-24fix simple clippy lintsklensy-41/+41
2022-05-24Rollup merge of #97288 - compiler-errors:tcxify-rustdoc, r=Dylan-DPCDylan DPC-150/+162
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-16/+43
rustdoc: Remove fields_stripped fields (and equivalents) Fixes #90588. r? `@camelid`
2022-05-23Auto merge of #97195 - notriddle:notriddle/cleanup, r=GuillaumeGomezbors-31/+32
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-22Clean up `&args[..]`, use more readable `args.iter()` insteadMichael Howell-1/+1
2022-05-22Lifetime variance fixes for rustdocMichael Goulet-150/+162
2022-05-22Auto merge of #97177 - oli-obk:const-stability, r=davidtwcobors-3/+3
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-21Extend `substs_to_args` into a perfectly-sized Vec almost every timeMichael Howell-16/+16
2022-05-21Shrink GenericArgs/PathSegment with boxed slicesMichael Howell-14/+15
2022-05-21Remove unused Hash impl from DocFragmentKindMichael Howell-1/+1
2022-05-21rustdoc: Stop using `write!` in `UrlFragment::render`Vadim Petrochenkov-1/+1
2022-05-21Remove fields_stripped fields (and equivalents)Guillaume Gomez-16/+43
2022-05-21Auto merge of #93963 - GuillaumeGomez:reduce-clean-type-size, r=notriddlebors-201/+212
rustdoc: Reduce clean::Type size There is no need to keep the `DefId` around since it's allow used to compute if we should show a cast or not. As such, we can simply directly store the boolean. I think it's not what you had in mind `@camelid` but I guess it's still an improvement? :wink: It was discussed in https://github.com/rust-lang/rust/pull/93941. r? `@camelid`
2022-05-21Remove `crate` visibility modifier in libs, testsJacob Pratt-340/+348
2022-05-19Add and use stability helper methodsJacob Pratt-3/+3
This avoids an ambiguity (when reading) where `.level.is_stable()` is not immediately clear whether it is general stability or const stability.
2022-05-15Prevent to recompute `should_show_cast` by passing down `self_def_id`Guillaume Gomez-197/+191
2022-05-15Reduce clean::Type size by replacing a DefId (only used to check for ↵Guillaume Gomez-13/+30
display) with a boolean
2022-05-14Auto merge of #96883 - jackh726:early-binder-2, r=oli-obkbors-11/+11
Add EarlyBinder Chalk has no concept of `Param` (https://github.com/rust-lang/chalk/blob/e0ade19d139bc784384acc6736cd960c91dd55a1/chalk-ir/src/lib.rs#L579) or `ReEarlyBound` (https://github.com/rust-lang/chalk/blob/e0ade19d139bc784384acc6736cd960c91dd55a1/chalk-ir/src/lib.rs#L1308). Everything is just "bound" - the equivalent of rustc's late-bound. It's not completely clear yet whether to move everything to the same time of binder in rustc or add `Param` and `ReEarlyBound` in Chalk. Either way, tracking when we have or haven't already substituted out these in rustc can be helpful. As a first step, I'm just adding a `EarlyBinder` newtype that is required to call `subst`. I also add a couple "transparent" `bound_*` wrappers around a couple query that are often immediately substituted. r? `@nikomatsakis`
2022-05-13Add bound_impl_trait_refJack Huey-5/+5
2022-05-13Add bound_type_ofJack Huey-5/+5
2022-05-12Auto merge of #95562 - lcnr:attr-no-encode, r=davidtwcobors-19/+25
don't encode only locally used attrs Part of https://github.com/rust-lang/compiler-team/issues/505. We now filter builtin attributes before encoding them in the crate metadata in case they should only be used in the local crate. To prevent accidental misuse `get_attrs` now requires the caller to state which attribute they are interested in. For places where that isn't trivially possible, I've added a method `fn get_attrs_unchecked` which I intend to remove in a followup PR. After this pull request landed, we can then slowly move all attributes to only be used in the local crate while being certain that we don't accidentally try to access them from extern crates. cc https://github.com/rust-lang/rust/pull/94963#issuecomment-1082924289
2022-05-11Rollup merge of #91518 - luojia65:rustdoc-riscv-arch, r=GuillaumeGomezDylan DPC-0/+2
Add readable rustdoc display for RISC-V target This pull request adds a human readable rustdoc display for RISC-V architecture. Target configuration marked as `#[cfg(target_arch = "riscv32")]` or `#[cfg(target_arch = "riscv64")]` are pretty formatted like `RISC-V RV32` and `RISC-V RV64` in Rust docs. Before: ![图片](https://user-images.githubusercontent.com/40385009/152681944-58d758ae-ac4f-412b-b70c-1e673a2a071e.png) After: ![图片](https://user-images.githubusercontent.com/40385009/152681923-91d5fe75-c3b2-4ac2-865c-54eac0aefe8d.png)
2022-05-10Introduce EarlyBinderJack Huey-5/+5