about summary refs log tree commit diff
path: root/src/librustdoc/clean
AgeCommit message (Collapse)AuthorLines
2023-05-30rustdoc: simplify `clean` by removing `FnRetTy`Michael Howell-35/+18
The default fn ret ty is always unit. Just use that. Looking back at the time when `FnRetTy` (then called `FunctionRetTy`) was first added to rustdoc, it seems to originally be there because `-> !` was a special form: the never type didn't exist back then. https://github.com/rust-lang/rust/commit/eb01b17b06eb35542bb80ff7456043b0ed5572ba#diff-384affc1b4190940f114f3fcebbf969e7e18657a71ef9001da6b223a036687d9L921-L924
2023-05-29EarlyBinder::new -> EarlyBinder::bindlcnr-1/+1
2023-05-28Make EarlyBinder's inner value private; and fix all of the resulting errorsKyle Matsuda-6/+6
2023-05-28Replace EarlyBinder(x) with EarlyBinder::new(x)Kyle Matsuda-1/+1
2023-05-27Rollup merge of #112018 - GuillaumeGomez:cleanup-tcx, r=notriddleMatthias Krüger-3/+3
Clean up usage of `cx.tcx` when `tcx` is already set into a variable I discovered a few cases where `cx.tcx` (and equivalents) was used whereas `tcx` was already stored into a variable. In those cases, better to just use `tcx` directly. r? `@notriddle`
2023-05-27Clean up usage of `cx.tcx` when `tcx` is already set into a variableGuillaume Gomez-3/+3
2023-05-27Rollup merge of #111997 - GuillaumeGomez:re-export-doc-hidden-macros, ↵Guillaume Gomez-1/+2
r=notriddle Fix re-export of doc hidden macro not showing up It's part of the follow-up of https://github.com/rust-lang/rust/pull/109697. Re-exports of doc hidden macros should be visible. It was the only kind of re-export of doc hidden item that didn't show up. r? `@notriddle`
2023-05-26Fix re-export of doc hidden macro not showing upGuillaume Gomez-1/+2
2023-05-22rustdoc: Cleanup doc string collapsingVadim Petrochenkov-44/+26
2023-05-13refactor: add chunks method to TokenStream to obviate rustdoc clonesCaleb Cartwright-2/+1
2023-05-10Use proper impl self type for alias impl in rustdocMichael Goulet-8/+9
2023-05-10Rollup merge of #111095 - GuillaumeGomez:fix-assoc-item-trait-inside-hidden, ↵Matthias Krüger-24/+41
r=notriddle Correctly handle associated items of a trait inside a `#[doc(hidden)]` item Fixes https://github.com/rust-lang/rust/issues/111064. cc `@compiler-errors` r? `@notriddle`
2023-05-05Improve code to remove duplicationGuillaume Gomez-28/+24
2023-05-05Modules can be reexported and it should be handled by rustdocGuillaume Gomez-1/+22
2023-05-04IAT: Rustdoc integrationLeón Orell Valerian Liehr-19/+57
2023-05-04IAT: Introduce AliasKind::InherentLeón Orell Valerian Liehr-0/+4
2023-05-04Auto merge of #110806 - WaffleLapkin:unmkI, r=lcnrbors-2/+2
Replace `tcx.mk_trait_ref` with `TraitRef::new` First step in implementing https://github.com/rust-lang/compiler-team/issues/616 r? `@lcnr`
2023-05-02resolve: One more attempt to simplify `module_children`Vadim Petrochenkov-3/+4
2023-04-30Rollup merge of #110631 - notriddle:notriddle/impl-trait-cycle, r=GuillaumeGomezMatthias Krüger-18/+41
rustdoc: catch and don't blow up on impl Trait cycles Fixes #110629 An odd feature of Rust is that `Foo` is invalid, but `Bar` is okay: type Foo<'a, 'b> = Box<dyn PartialEq<Foo<'a, 'b>>>; type Bar<'a, 'b> = impl PartialEq<Bar<'a, 'b>>; To get it right, track every time rustdoc descends into a type alias, so if it shows up twice, it can be write the path instead of infinitely expanding it.
2023-04-29rustdoc: catch and don't blow up on impl Trait cyclesMichael Howell-18/+41
An odd feature of Rust is that `Foo` is invalid, but `Bar` is okay: type Foo<'a, 'b> = Box<dyn PartialEq<Foo<'a, 'b>>>; type Bar<'a, 'b> = impl PartialEq<Bar<'a, 'b>>; To get it right, track every time rustdoc descends into a type alias, so if it shows up twice, it can be write the path instead of infinitely expanding it.
2023-04-29Unify attributes retrieval for JSON and HTML renderingGuillaume Gomez-0/+73
2023-04-28Rollup merge of #110904 - fmease:rustdoc-fix-110900, r=compiler-errorsMatthias Krüger-5/+5
rustdoc: rebind bound vars to type-outlives predicates Fixes #110900.
2023-04-27rustdoc: rebind bound vars to type-outlives predicatesLeón Orell Valerian Liehr-5/+5
2023-04-26Fix uses of `TraitRef::identity` in clippy and rustdocMaybe Waffle-1/+1
2023-04-26Make some region folders a little stricter.Nicholas Nethercote-1/+3
Because certain regions cannot occur in them.
2023-04-25Rollup merge of #110556 - kylematsuda:earlybinder-explicit-item-bounds, ↵Matthias Krüger-6/+7
r=compiler-errors Switch to `EarlyBinder` for `explicit_item_bounds` Part of the work to finish https://github.com/rust-lang/rust/issues/105779. This PR adds `EarlyBinder` to the return type of the `explicit_item_bounds` query and removes `bound_explicit_item_bounds`. r? `@compiler-errors` (hope it's okay to request you, since you reviewed #110299 and #110498 :smiley:)
2023-04-25Use `ty::TraitRef::new` in rustdocMaybe Waffle-1/+1
2023-04-24Fix `rustc_index` imports outside the compilerMaybe Waffle-1/+1
2023-04-20add subst_identity_iter and subst_identity_iter_copied methods on ↵Kyle Matsuda-4/+2
EarlyBinder; use this to simplify some EarlyBinder noise around explicit_item_bounds calls
2023-04-20add EarlyBinder to output of explicit_item_bounds; replace ↵Kyle Matsuda-3/+3
bound_explicit_item_bounds usages; remove bound_explicit_item_bounds query
2023-04-20change usages of explicit_item_bounds to bound_explicit_item_boundsKyle Matsuda-8/+11
2023-04-20Remove WithOptconstParam.Camille GILLOT-2/+2
2023-04-19Fix missing blanket impl if the trait is not directly publicGuillaume Gomez-1/+1
2023-04-17Rollup merge of #110421 - jsoref:spelling-librustdoc, r=notriddleMatthias Krüger-6/+6
Spelling librustdoc This is split from https://github.com/rust-lang/rust/pull/110392 There's one change to src/tools/rustdoc-gui/tester.js which feels like a reasonable thing to piggy-back here.
2023-04-16Spelling librustdocJosh Soref-6/+6
* associated * collected * correspondence * inlining * into * javascript * multiline * variadic Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-16Auto merge of #110405 - fee1-dead-contrib:rollup-9rkree6, r=fee1-deadbors-1/+1
Rollup of 4 pull requests Successful merges: - #110397 (Move some utils out of `rustc_const_eval`) - #110398 (use matches! macro in more places) - #110400 (more clippy fixes: clippy::{iter_cloned_collect, unwarp_or_else_defau…) - #110402 (Remove the loop in `Align::from_bytes`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-04-16Rollup merge of #110345 - nnethercote:rm-Super-impls-for-Region, ↵fee1-dead-6/+5
r=compiler-errors Remove `TypeSuper{Foldable,Visitable}` impls for `Region`. These traits exist so that folders/visitors can recurse into types of interest: binders, types, regions, predicates, and consts. But `Region` is non-recursive and cannot contain other types of interest, so its methods in these traits are trivial. This commit inlines and removes those trivial methods. r? `@compiler-errors`
2023-04-16more clippy fixes: clippy::{iter_cloned_collect, unwarp_or_else_default, ↵Matthias Krüger-1/+1
option_map_or_none}
2023-04-16Remove `TypeSuper{Foldable,Visitable}` impls for `Region`.Nicholas Nethercote-6/+5
These traits exist so that folders/visitors can recurse into types of interest: binders, types, regions, predicates, and consts. But `Region` is non-recursive and cannot contain other types of interest, so its methods in these traits are trivial. This commit inlines and removes those trivial methods.
2023-04-14Rollup merge of #110244 - kadiwa4:unnecessary_imports, r=JohnTitorMatthias Krüger-3/+1
Remove some unneeded imports / qualified paths Continuation of #105537.
2023-04-14Rollup merge of #110279 - GuillaumeGomez:compiler-macro-derive, r=notriddleMatthias Krüger-40/+55
rustdoc: Correctly handle built-in compiler proc-macros as proc-macro and not macro Part of https://github.com/rust-lang/rust/issues/110111. There were actually one issue split in two parts: * Compiler built-in proc-macro were incorrectly considered as macros and not proc-macros. * Re-exports of compiler built-in proc-macros were considering them as macros. Both issues can be fixed by looking at the `MacroKind` variant instead of just relying on information extracted later on. r? ``@fmease``
2023-04-13Correctly handle built-in compiler proc-macros as proc-macro and not macroGuillaume Gomez-40/+55
2023-04-12remove some unneeded importsKaDiWa-3/+1
2023-04-12resolve: Pre-compute non-reexport module childrenVadim Petrochenkov-2/+2
Instead of repeating the same logic by walking HIR during metadata encoding. The only difference is that we are no longer encoding `macro_rules` items, but we never currently need them as a part of this list. They can be encoded separately if this need ever arises. `module_reexports` is also un-querified, because I don't see any reasons to make it a query, only overhead.
2023-04-11Rollup merge of #96971 - zhaixiaojuan:master, r=wesleywiserMichael Goulet-0/+1
Initial support for loongarch64-unknown-linux-gnu Hi, We hope to add a new port in rust for LoongArch. LoongArch intro LoongArch is a RISC style ISA which is independently designed by Loongson Technology in China. It is divided into two versions, the 32-bit version (LA32) and the 64-bit version (LA64). LA64 applications have application-level backward binary compatibility with LA32 applications. LoongArch is composed of a basic part (Loongson Base) and an expanded part. The expansion part includes Loongson Binary Translation (LBT), Loongson VirtualiZation (LVZ), Loongson SIMD EXtension (LSX) and Loongson Advanced SIMD EXtension(LASX). Currently the LA464 processor core supports LoongArch ISA and the Loongson 3A5000 processor integrates 4 64-bit LA464 cores. LA464 is a four-issue 64-bit high-performance processor core. It can be used as a single core for high-end embedded and desktop applications, or as a basic processor core to form an on-chip multi-core system for server and high-performance machine applications. Documentations: ISA: https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html ABI: https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html More docs can be found at: https://loongson.github.io/LoongArch-Documentation/README-EN.html Since last year, we have locally adapted two versions of rust, rust1.41 and rust1.57, and completed the test locally. I'm not sure if I'm submitting all the patches at once, so I split up the patches and here's one of the commits
2023-04-11Auto merge of #109765 - petrochenkov:encodeless, r=cjgillotbors-1/+1
rustc_metadata: Filter encoded data more aggressively using `DefKind` I focused on data that contains spans, because spans are expensive to encode/decode/hash, but also touched `should_encode_visibility` too. One incorrect use of impl visibility in diagnostics is also replaced with trait visibility.
2023-04-10fix(doc): do not parse inline when output is json for external cratebohan-2/+3
2023-04-10rustc_metadata: Filter encoded data more aggressively using `DefKind`Vadim Petrochenkov-1/+1
2023-04-08rustc_middle: Remove `Option` from `module_reexports` queryVadim Petrochenkov-2/+1
2023-04-08rustdoc: Migrate some logic to `module_reexports`Vadim Petrochenkov-140/+29