about summary refs log tree commit diff
path: root/src/librustdoc/clean
AgeCommit message (Collapse)AuthorLines
2022-11-08Auto merge of #104013 - notriddle:notriddle/rustdoc-sizeof, r=GuillaumeGomezbors-27/+21
rustdoc: use `ThinVec` and `Box<str>` to shrink `clean::ItemKind`
2022-11-07Rollup merge of #103885 - fmease:rustdoc-various-cross-crate-reexport-fixes, ↵Yuki Okushi-40/+87
r=cjgillot,GuillaumeGomez rustdoc: various cross-crate reexport fixes Fixes for various smaller cross-crate reexport issues. The PR is split into several commits for easier review. Will be squashed after approval. Most notable changes: * We finally render late-bound lifetimes in the generic parameter list of cross-crate functions & methods. Previously, we would display the re-export of `pub fn f<'s>(x: &'s str) {}` as `pub fn f(x: &'s str)` * We now render unnamed parameters of cross-crate functions and function pointers as underscores since that's exactly what we do for local definitions, too. Mentioned as a bug in #44306. * From now on, the rendering of cross-crate trait-object types is more correct: * `for<>` parameter lists (for higher-ranked lifetimes) are now shown * the return type of `Fn{,Mut,Once}` trait bounds is now displayed Regarding the last list item, here is a diff for visualization (before vs. after): ```patch - dyn FnOnce(&'any str) + 'static + dyn for<'any> FnOnce(&'any str) -> bool + 'static ``` The redundant `+ 'static` will be removed in a follow-up PR that will hide trait-object lifetime-bounds if they coincide with [their default](https://doc.rust-lang.org/reference/lifetime-elision.html#default-trait-object-lifetimes) (see [Zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/clean_middle_ty.3A.20I.20need.20to.20add.20a.20parameter/near/307143097)). `FIXME(fmease)`s were added. ``@rustbot`` label A-cross-crate-reexports r? ``@GuillaumeGomez``
2022-11-05rustdoc: print usize with less string manipulationMichael Howell-12/+6
2022-11-05rustdoc: use `ThinVec` and `Box<str>` to shrink `clean::ItemKind`Michael Howell-15/+15
2022-11-05Rollup merge of #103621 - fee1-dead-contrib:iat-fix-use, r=cjgillotDylan DPC-1/+2
Correctly resolve Inherent Associated Types I don't know if this is the best way to do this, but at least it is one way.
2022-11-04rustdoc: create helper `GenericParamDef::lifetime`León Orell Valerian Liehr-28/+13
2022-11-04rustdoc: add test for cross-crate trait-object typesLeón Orell Valerian Liehr-0/+3
as well as some FIXMEs
2022-11-04rustdoc: render the return type of cross-crate `Fn`-family trait bounds in ↵León Orell Valerian Liehr-7/+7
trait-object types
2022-11-04rustdoc: render `for<>` param lists of cross-crate trait-object typesLeón Orell Valerian Liehr-2/+19
2022-11-04rustdoc: move cross-crate lifetime/outlives bounds on GAT params from ↵León Orell Valerian Liehr-1/+10
where-clause to param declaration site I've overlooked this in #103190.
2022-11-04rustdoc: render unnamed arguments as underscores in cross-crate functions & ↵León Orell Valerian Liehr-7/+13
function pointers for consistency with the way we display local definitions (cleaned from HIR, not from rustc_middle).
2022-11-04rustdoc: render late-bound lifetimes in generic parameter list of ↵León Orell Valerian Liehr-7/+34
cross-crate functions and methods
2022-11-04Rollup merge of #103935 - GuillaumeGomez:remove-rustdoc-visibility-ty, ↵Matthias Krüger-44/+19
r=notriddle Remove rustdoc clean::Visibility type Fixes #90852. Follow-up of https://github.com/rust-lang/rust/pull/103690. This PR completely removes the rustdoc `clean::Visibility` type to use the `rustc_middle` one instead. I don't think there will be any impact on perf. r? `@notriddle`
2022-11-04Auto merge of #103954 - matthiaskrgr:rollup-tskpxnj, r=matthiaskrgrbors-17/+20
Rollup of 10 pull requests Successful merges: - #103825 (Remove let_underscore_must_use from list of uplifted lints) - #103884 (Add visit_fn_ret_ty to hir intravisit) - #103892 (Properly render asyncness for trait fns without default body) - #103905 (rustdoc: remove redundant mobile CSS `.sidebar-elems { background }`) - #103912 (Add howto for adding new targets) - #103915 (Improve use of ErrorGuaranteed and code cleanup) - #103930 (Move some tests from `src/test/ui` to more reasonable places) - #103931 (Add note to RELEASES.md regarding issue 102754.) - #103938 (rustdoc: clean up hardcoded CSS border color on search results) - #103940 (rustdoc: remove no-op CSS `#main-content > .item-info { margin-top: 0 }`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-04Rollup merge of #103892 - compiler-errors:afit-rustdoc, r=GuillaumeGomezMatthias Krüger-17/+20
Properly render asyncness for trait fns without default body We weren't properly desugaring async fns in traits unless they had default bodies (in which case rustdoc treats them much like they came from an impl). cc ```@yoshuawuyts``` should help with https://rust-lang.zulipchat.com/#narrow/stream/330606-wg-async.2Fasync-fn-in-trait-impl/topic/type.20inside.20.60async.20fn.60.20body.20must.20be.20known.20in.20this.20context/near/306894869
2022-11-04Auto merge of #102928 - notriddle:notriddle/rustdoc-thin-vec, r=GuillaumeGomezbors-63/+60
rustdoc: use ThinVec for cleaned generics Depends on https://github.com/Gankra/thin-vec/pull/38
2022-11-03Remove rustdoc clean::Visibility typeGuillaume Gomez-44/+19
2022-11-03roll another resolution logic in rustdocDeadbeef-1/+2
2022-11-02rustdoc: add size tracking for `Generics`Michael Howell-0/+1
2022-11-02rustdoc: remove unneeded Box from ItemKindMichael Howell-3/+3
2022-11-02rustdoc: use ThinVec for cleaned genericsMichael Howell-60/+56
2022-11-02Properly render asyncness for traits without default bodyMichael Goulet-17/+20
2022-11-02Fix merge of attributes for reexports of local itemsGuillaume Gomez-5/+21
2022-11-02Auto merge of #103690 - GuillaumeGomez:visibility-on-demand, r=notriddlebors-97/+84
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`
2022-11-02Auto merge of #103649 - petrochenkov:docnotrait, r=GuillaumeGomezbors-4/+0
rustdoc: Do not add external traits to the crate in `register_res` It's not clear why it was done, and apparently it's no longer necessary now. Such additions are unpredictable for early doc link resolution and would force us to collect all doc links from all external traits. Fixes https://github.com/rust-lang/rust/issues/103463
2022-10-30Rollup merge of #103746 - notriddle:notriddle/incoherent-dyn-trait, ↵Michael Howell-0/+15
r=GuillaumeGomez rustdoc: add support for incoherent impls on structs and traits Fixes #103170
2022-10-30Make rustdoc Item::visibility computed on-demandGuillaume Gomez-97/+84
2022-10-30rustdoc: Do not add external traits to the crate in `register_res`Vadim Petrochenkov-4/+0
It's not clear why it was done, and apparently it's no longer necessary now. Such additions are unpredictable for early doc link resolution and would force us to collect all doc links from all external traits.
2022-10-29rustdoc: add support for incoherent impls on structs and traitsMichael Howell-0/+15
Fixes #103170
2022-10-29rustdoc: Split effective visibilities from rustc from similar data built by ↵Vadim Petrochenkov-4/+4
rustdoc for external def-ids
2022-10-29rustdoc: Simplify modifications of effective visibility tableVadim Petrochenkov-2/+1
2022-10-29Rollup merge of #103625 - WaffleLapkin:no_tyctxt_dogs_allowed, r=compiler-errorsGuillaume Gomez-1/+1
Accept `TyCtxt` instead of `TyCtxtAt` in `Ty::is_*` functions Functions in answer: - `Ty::is_freeze` - `Ty::is_sized` - `Ty::is_unpin` - `Ty::is_copy_modulo_regions` This allows to remove a lot of useless `.at(DUMMY_SP)`, making the code a bit nicer :3 r? `@compiler-errors`
2022-10-29Rename some `OwnerId` fields.Nicholas Nethercote-19/+19
spastorino noticed some silly expressions like `item_id.def_id.def_id`. This commit renames several `def_id: OwnerId` fields as `owner_id`, so those expressions become `item_id.owner_id.def_id`. `item_id.owner_id.local_def_id` would be even clearer, but the use of `def_id` for values of type `LocalDefId` is *very* widespread, so I left that alone.
2022-10-29Auto merge of #102233 - petrochenkov:effvis, r=jackh726bors-4/+4
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-28Rollup merge of #103523 - GuillaumeGomez:inline-doc-comment-impl-block, ↵Matthias Krüger-8/+35
r=notriddle Fix unwanted merge of inline doc comments for impl blocks Fixes https://github.com/rust-lang/rust/issues/102909. We need this merge mechanism for inlined items but it's completely unwanted for impl blocks (at least the doc comments are, not the other attributes) since we want to keep what `cfg()` is put on the `pub use` or other attributes. r? ``@notriddle``
2022-10-27Update toolingMaybe Waffle-1/+1
2022-10-27Rollup merge of #103408 - compiler-errors:rpitit-rustdoc, r=GuillaumeGomezMatthias Krüger-53/+69
Clean return-position `impl Trait` in traits correctly in rustdoc Fixes #103403
2022-10-26privacy: Rename "accessibility levels" to "effective visibilities"Vadim Petrochenkov-4/+4
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-23Rollup merge of #103254 - fmease:fix-24183, r=GuillaumeGomezMichael Howell-18/+23
rustdoc: do not filter out cross-crate `Self: Sized` bounds All type parameters **except `Self`** are implicitly `Sized` ([via](https://doc.rust-lang.org/nightly/std/marker/trait.Sized.html)). Previously, we disregarded the exception of `Self` and omitted cross-crate `Sized` bounds of *any* type parameter *including* `Self` when rendering. From now on, we *do* render cross-crate `Self: Sized` bounds. Most notably, in `std` we now finally properly render the `Sized` bound of the `Clone` trait as well as the `Self: Sized` bound on `Iterator::map`. Fixes #24183. ``@rustbot`` label T-rustdoc A-cross-crate-reexports r? rustdoc
2022-10-23Rollup merge of #103192 - petrochenkov:noalltraits, r=jyn514Dylan DPC-94/+102
rustdoc: Eliminate uses of `EarlyDocLinkResolver::all_traits` Another step to https://github.com/rust-lang/rust/pull/94857.
2022-10-22Clean middle RPITITs correctly in rustdocMichael Goulet-53/+69
2022-10-19rustdoc: render bounds of cross-crate GAT paramsLeón Orell Valerian Liehr-14/+30
2022-10-19rustdoc: Do not filter out `Self: Sized` boundsLeón Orell Valerian Liehr-18/+23
2022-10-19rustdoc: Eliminate uses of `EarlyDocLinkResolver::all_traits`Vadim Petrochenkov-94/+102
2022-10-14Add some tidy-alphabeticalnils-1/+2
2022-10-14Rollup merge of #103018 - Rageking8:more-dupe-word-typos, r=TaKO8KiDylan DPC-1/+1
More dupe word typos I only picked those changes (from the regex search) that I am pretty certain doesn't change meaning and is just a typo fix. Do correct me if any fix is undesirable and I can revert those. Thanks.
2022-10-14more dupe word typosRageking8-1/+1
2022-10-13rustdoc: don't ICE on `TyKind::Typeof`Maybe Waffle-2/+1
2022-10-10Rollup merge of #102834 - compiler-errors:unnecessary-lift, r=jyn514Yuki Okushi-17/+9
Remove unnecessary `lift`/`lift_to_tcx` calls from rustdoc Not sure why they were here in the first place