summary refs log tree commit diff
path: root/src/librustdoc/clean
AgeCommit message (Collapse)AuthorLines
2024-12-31Unsafe binder support in rustdocMichael Goulet-5/+32
2024-12-28nits: librustdoc::cleanAlexis (Poliorcetics) Bourget-12/+10
- librustdoc::clean::clean_lifetime doesn't need a mut doc context - librustdoc::clean::normalize doesn't need a mut doc context - move Some() wrapping up into `clean_predicate()` - simplify nested if in librustdoc::clean::record_extern_fqn()
2024-12-25Improve rustdoc codeGuillaume Gomez-3/+3
2024-12-25Auto merge of #134703 - poliorcetics:ab/push-ovsylkzsoxku, r=GuillaumeGomezbors-12/+10
nits: Cleanup of `librustdoc::clean::Cfg::simplify_with` r? `@GuillaumeGomez`
2024-12-24nit: cleanups in `Cfg::simplify_with`Alexis (Poliorcetics) Bourget-12/+10
2024-12-22Begin to implement type system layer of unsafe bindersMichael Goulet-0/+2
2024-12-20Rollup merge of #134321 - dtolnay:docassocconst, r=fmeaseJacob Pratt-38/+55
Hide `= _` as associated constant value inside impl blocks Closes #134320. ### Before: <img src="https://github.com/user-attachments/assets/19d28811-45d2-4563-9726-f40c6af411c6" width="300">&nbsp;<img src="https://github.com/user-attachments/assets/1ecf8764-97ce-47f0-87fa-3b174d2fc578" width="300"> ### After: <img src="https://github.com/user-attachments/assets/6408c4ca-b1c4-42e4-884b-248833a4865f" width="300">&nbsp;<img src="https://github.com/user-attachments/assets/df2f6981-16f6-409f-8abb-73c0a4a71d6b" width="300"> r? `@fmease`
2024-12-19Rename TyMethodItem -> RequiredMethodItemDavid Tolnay-7/+9
2024-12-19Rename TyAssocTypeItem -> RequiredAssocTypeItemDavid Tolnay-7/+7
2024-12-19Split AssocConstItem into ProvidedAssocConstItem and ImplAssocConstItemDavid Tolnay-21/+32
2024-12-19Rename TyAssocConstItem -> RequiredAssocConstItemDavid Tolnay-8/+12
2024-12-18Rollup merge of #134161 - nnethercote:overhaul-token-cursors, r=spastorino许杰友 Jieyou Xu (Joe)-2/+2
Overhaul token cursors Some nice cleanups here. r? `````@davidtwco`````
2024-12-18Rename `RefTokenTreeCursor`.Nicholas Nethercote-2/+2
Because `TokenStreamIter` is a much better name for a `TokenStream` iterator. Also rename the `TokenStream::trees` method as `TokenStream::iter`, and some local variables.
2024-12-17Auto merge of #134376 - jdonszelmann:fix-rustdoc-perf, r=jieyouxubors-1/+1
Try to fix perf regression in rustdoc after hir attributes Slight performance regression introduced in #131808 r? `@jieyouxu`
2024-12-16rename rustc_attr to rustc_attr_parsing and create rustc_attr_data_structuresJonathan Dönszelmann-1/+1
2024-12-16split attributesJonathan Dönszelmann-6/+5
2024-12-16try fix hir-attrs perfJonathan Dönszelmann-1/+1
2024-12-15Add hir::AttributeJonathan Dönszelmann-51/+49
2024-12-14(Re-)Implement impl_trait_in_bindingsMichael Goulet-2/+6
2024-12-12Fix toolsMichael Goulet-0/+3
2024-12-10Remove more traces of anonymous ADTsMichael Goulet-3/+0
2024-12-06remove eq for attributesJonathan Dönszelmann-13/+0
2024-12-02Rollup merge of #133746 - oli-obk:push-xwyrylxmrtvq, r=jieyouxuGuillaume Gomez-1/+1
Change `AttrArgs::Eq` to a struct variant Cleanups for simplifying https://github.com/rust-lang/rust/pull/131808 Basically changes `AttrArgs::Eq` to a struct variant and then avoids several matches on `AttrArgsEq` in favor of methods on it. This will make future refactorings simpler, as they can either keep methods or switch to field accesses without having to restructure code
2024-12-02Change `AttrArgs::Eq` into a struct variantOli Scherer-1/+1
2024-12-01Rollup merge of #133589 - voidc:remove-array-len, r=boxyuwuJacob Pratt-22/+25
Remove `hir::ArrayLen` This refactoring removes `hir::ArrayLen`, replacing it with `hir::ConstArg`. To represent inferred array lengths (previously `hir::ArrayLen::Infer`), a new variant `ConstArgKind::Infer` is added. r? `@BoxyUwU`
2024-11-30Remove hir::ArrayLen, introduce ConstArgKind::InferDominik Stolz-22/+25
Remove Node::ArrayLenInfer
2024-11-28uplift fold_regions to rustc_type_irlcnr-1/+2
2024-11-28Fix new clippy lintsGuillaume Gomez-27/+27
2024-11-26Rollup merge of #133443 - fmease:rm-dead-eff-code-ii, r=compiler-errorsGuillaume Gomez-8/+0
Remove dead code stemming from the old effects desugaring (II) Follow-up to #132374. r? project-const-traits
2024-11-25Remove dead code stemming from the old effects desugaring (II)León Orell Valerian Liehr-8/+0
2024-11-25Refactor `where` predicates, and reserve for attributes supportFrank King-5/+5
2024-11-20Auto merge of #133212 - lcnr:questionable-uwu, r=compiler-errorsbors-9/+7
continue `ParamEnv` to `TypingEnv` transition cc #132279 r? `@compiler-errors`
2024-11-19rustdoc: yeet `TypingEnv::from_param_env`lcnr-9/+7
2024-11-19move `fn is_item_raw` to `TypingEnv`lcnr-1/+1
2024-11-19Introduce `min_generic_const_args` and directly represent pathsNoah Lev-7/+8
Co-authored-by: Boxy UwU <rust@boxyuwu.dev> Co-authored-by: León Orell Valerian Liehr <me@fmease.dev>
2024-11-18use `TypingEnv` when no `infcx` is availablelcnr-6/+11
the behavior of the type system not only depends on the current assumptions, but also the currentnphase of the compiler. This is mostly necessary as we need to decide whether and how to reveal opaque types. We track this via the `TypingMode`.
2024-11-13Rollup merge of #132302 - fmease:rustdoc-better-vis-for-macro-decl, r=notriddleMatthias Krüger-32/+14
rustdoc: Treat declarative macros more like other item kinds Apparently at some time in the past we were unable to generate an href for the module path inside the visibility of decl macros 2.0 (`pub(in ...)`). As a result of this, a whole separate function was introduced specifically for printing the visibility of decl macros that didn't attempt to generate any links. The description of PR https://github.com/rust-lang/rust/pull/84074 states: > This fixes the overly-complex invariant mentioned in https://github.com/rust-lang/rust/pull/83237#issuecomment-815346570, where the macro source can't have any links in it only because the cache hasn't been populated yet. I can no longer reproduce the original issue. Reusing the existing visibility rendering logic *seems* to work just fine (I couldn't come up with any counterexamples, though I invite you to prove me wrong). * Fixes #83000 * Fixes the visibility showing up "twice" in rustdoc-JSON output: Once as the `visibility` field, once baked into the source[^1] * Fixes `#[doc(hidden)]` not getting rendered on doc(hidden) decl macros 2.0 under `--document-hiden-items` (for decl macros 1.2 the issue remains; I will address this separately when fixing #132304). --- <details><summary>Outdated Section</summary> NOTE: The current version of this PR is committing a UI crime, I'd like to receive feedback on that. Maybe you have a satisfactory solution for how to remedy it. Namely, as you know we have two different ways of / modes for highlighting code with color: 1. Only highlighting links / item paths and avoiding to highlight tokens by kind like keywords (to reduce visual noise and maybe also artifact size). Used for item declarations(\*). 2. Highlighting tokens by kind. Used for code blocks written by the user. (\*): With the notable exception being macro declarations! Well, since this PR reuses the same function for rendering the item visibility (which only makes sense), we have a clash of modes: We now use both ways of highlighting code for decl macros: №1 for the visibility, №2 for the rest. This awkward. See for yourself: * On master: ![Screenshot 2024-10-29 at 03-37-48 by_example_vis_named in decl_macro a b c - Rust](https://github.com/user-attachments/assets/22f0ab6e-9ba9-4c4e-8fb0-0741c91d360b) * On this branch: ![Screenshot 2024-10-29 at 03-36-41 by_example_vis_named in decl_macro a b c - Rust](https://github.com/user-attachments/assets/b11d81a3-3e2e-43cb-a5b8-6773a3048732) </details> Furthermore, we now no longer syntax-highlight declarative macros (be it `macro_rules!` or `macro`) since that was inconsistent with the way we render all other item kinds. See (collapsed) *Outdated Section* above. See also https://github.com/rust-lang/rust/pull/132302#discussion_r1821310783. | On master | On this branch | |---|---| | ![Screenshot 2024-11-13 at 16-12-46 by_example_vis_named in decl_macro a b c - Rust](https://github.com/user-attachments/assets/cb3aeb42-a56d-4ced-80d9-f2694f369af1) | ![Screenshot 2024-11-13 at 16-13-22 by_example_vis_named in decl_macro a b c - Rust](https://github.com/user-attachments/assets/b73bee50-1b85-4862-afba-5ad471443ccc) | [^1]: E.g., `"visibility":{"restricted":{"parent":1,"path":"::a"}},/*OMITTED*/,"inner":{"macro":"pub(in a) macro by_example_vis_named($foo:expr) {\n ...\n}"}`
2024-11-13rustdoc: Treat decl macros like other itemsLeón Orell Valerian Liehr-32/+14
2024-11-11[perf] rustdoc: Perform less work when cleaning parenthesized generic argsLeón Orell Valerian Liehr-25/+19
2024-11-06Clean middle generics using paren sugar if trait has rustc_paren_sugarMichael Goulet-1/+1
2024-11-05Auto merge of #132580 - compiler-errors:globs, r=Noratriebbors-16/+20
Remove unnecessary pub enum glob-imports from `rustc_middle::ty` We used to have an idiom in the compiler where we'd prefix or suffix all the variants of an enum, for example `BoundRegionKind`, with something like `Br`, and then *glob-import* that enum variant directly. `@noratrieb` brought this up, and I think that it's easier to read when we just use the normal style `EnumName::Variant`. This PR is a bit large, but it's just naming. The only somewhat opinionated change that this PR does is rename `BorrowKind::Imm` to `BorrowKind::Immutable` and same for the other variants. I think these enums are used sparingly enough that the extra length is fine. r? `@noratrieb` or reassign
2024-11-04Rename `DocContext::is_json` into `DocContext::is_json_output`Guillaume Gomez-2/+2
2024-11-04Fix invalid coverage computation when `--output-format=json` is enabledGuillaume Gomez-2/+2
2024-11-04ty::BrK -> ty::BoundRegionKind::KMichael Goulet-4/+8
2024-11-04ty::KContainer -> ty::AssocItemContainer::KMichael Goulet-12/+12
2024-11-03Rename the FIXMEs, remove a few that dont matter anymoreMichael Goulet-2/+2
2024-11-01rustdoc: Directly use rustc_abi instead of reexportsJubilee Young-4/+3
rustc_target reexports a lot of things that are in rustc_abi, but that will be over soon and now is probably a good time to switch. Uses of rustc_target remain where they inquire about the target tuple.
2024-10-30Remap impl-trait lifetimes on HIR instead of AST lowering.Camille GILLOT-1/+1
2024-10-29update toolslcnr-5/+5
2024-10-26expand: Stop using artificial `ast::Item` for macros loaded from metadataVadim Petrochenkov-20/+6