summary refs log tree commit diff
path: root/src/librustdoc/clean
AgeCommit message (Collapse)AuthorLines
2024-03-15Rollup merge of #122495 - Manishearth:rustdoc-👻👻👻, r=GuillaumeGomezMatthias Krüger-7/+19
Visually mark 👻hidden👻 items with document-hidden-items Fixes #122485 This adds a 👻 in the item list (much like the :lock: used for private items), and also shows `#[doc(hidden)]` in the code view, where `pub(crate)` etc gets shown for private items. This does not do anything for enum variants, if people have ideas. I think we can just show the attribute.
2024-03-14hir: Remove `opt_local_def_id_to_hir_id` and `opt_hir_node_by_def_id`Vadim Petrochenkov-7/+6
Also replace a few `hir_node()` calls with `hir_node_by_def_id()`
2024-03-14Refactor visibility_print_with_space to directly take an itemManish Goregaokar-7/+19
2024-03-12Change `DefKind::Static` to a struct variantOli Scherer-2/+2
2024-03-05Rename all `ParseSess` variables/fields/lifetimes as `psess`.Nicholas Nethercote-7/+7
Existing names for values of this type are `sess`, `parse_sess`, `parse_session`, and `ps`. `sess` is particularly annoying because that's also used for `Session` values, which are often co-located, and it can be difficult to know which type a value named `sess` refers to. (That annoyance is the main motivation for this change.) `psess` is nice and short, which is good for a name used this much. The commit also renames some `parse_sess_created` values as `psess_created`.
2024-03-04Remove `file_path_mapping` param from `ParseSess::new`.Nicholas Nethercote-3/+1
It's always empty.
2024-03-01Propegate HIR and AST `f16` and `f128` types to rustdocTrevor Gross-0/+4
2024-02-28Add basic support for `f16` and `f128` to rustdocTrevor Gross-0/+6
2024-02-25Rollup merge of #121060 - clubby789:bool-newtypes, r=cjgillotMatthias Krüger-2/+2
Add newtypes for bool fields/params/return types Fixed all the cases of this found with some simple searches for `*/ bool` and `bool /*`; probably many more
2024-02-20Expand weak alias types before collecting constrained and referenced late ↵León Orell Valerian Liehr-9/+8
bound regions
2024-02-20Add newtype for raw identsclubby789-2/+2
2024-02-17Fix missing trait impls for type in rustc docsShoyu Vanilla-7/+12
2024-02-16Auto merge of #120500 - oli-obk:intrinsics2.0, r=WaffleLapkinbors-1/+1
Implement intrinsics with fallback bodies fixes #93145 (though we can port many more intrinsics) cc #63585 The way this works is that the backend logic for generating custom code for intrinsics has been made fallible. The only failure path is "this intrinsic is unknown". The `Instance` (that was `InstanceDef::Intrinsic`) then gets converted to `InstanceDef::Item`, which represents the fallback body. A regular function call to that body is then codegenned. This is currently implemented for * codegen_ssa (so llvm and gcc) * codegen_cranelift other backends will need to adjust, but they can just keep doing what they were doing if they prefer (though adding new intrinsics to the compiler will then require them to implement them, instead of getting the fallback body). cc `@scottmcm` `@WaffleLapkin` ### todo * [ ] miri support * [x] default intrinsic name to name of function instead of requiring it to be specified in attribute * [x] make sure that the bodies are always available (must be collected for metadata)
2024-02-15Rollup merge of #121022 - fmease:rustdoc-x-crate-late-bound-lt-src-order, ↵Matthias Krüger-56/+74
r=GuillaumeGomez rustdoc: cross-crate re-exports: correctly render late-bound params in source order even if early-bound params are present r? ghost
2024-02-15rustdoc: cross-crate re-exports: correctly render late-bound params in ↵León Orell Valerian Liehr-56/+74
source order even if early-bound params are present
2024-02-13Rollup merge of #120999 - fmease:rustdoc-rm-instantiation-param, r=notriddleMatthias Krüger-68/+23
rustdoc: replace `clean::InstantiationParam` with `clean::GenericArg` Probably better known as `SubstParam` (until #120958 which should've probably renamed it to `InstantiatedParam` but anyways). It doesn't make any sense to me why it should exist as a separate type. `GenericArg` is exactly what we want here anyways from a semantic perspective. Both have the same size btw. I also took the liberty of doing some drive-by cleanups.
2024-02-13Rollup merge of #120548 - GuillaumeGomez:glob-reexport-cfg-merge, ↵Matthias Krüger-1/+1
r=GuillaumeGomez rustdoc: Fix handling of doc_auto_cfg feature for cfg attributes on glob reexport This is a follow-up of #120501 and a part of https://github.com/rust-lang/rust/issues/120487. r? `@notriddle`
2024-02-13Replace clean::InstantiationParam with clean::GenericArgLeón Orell Valerian Liehr-68/+23
2024-02-12Rollup merge of #120958 - ShoyuVanilla:remove-subst, r=oli-obkMatthias Krüger-7/+13
Dejargonize `subst` In favor of #110793, replace almost every occurence of `subst` and `substitution` from rustc codes, but they still remains in subtrees under `src/tools/` like clippy and test codes (I'd like to replace them after this)
2024-02-12Auto merge of #120980 - matthiaskrgr:rollup-dsjsqql, r=matthiaskrgrbors-1/+3
Rollup of 11 pull requests Successful merges: - #120765 (Reorder diagnostics API) - #120833 (More internal emit diagnostics cleanups) - #120899 (Gracefully handle non-WF alias in `assemble_alias_bound_candidates_recur`) - #120917 (Remove a bunch of dead parameters in functions) - #120928 (Add test for recently fixed issue) - #120933 (check_consts: fix duplicate errors, make importance consistent) - #120936 (improve `btree_cursors` functions documentation) - #120944 (Check that the ABI of the instance we are inlining is correct) - #120956 (Clean inlined type alias with correct param-env) - #120962 (Add myself to library/std review) - #120972 (fix ICE for deref coercions with type errors) r? `@ghost` `@rustbot` modify labels: rollup
2024-02-12Implement intrinsics with fallback bodiesOli Scherer-1/+1
2024-02-12Dejargnonize substShoyu Vanilla-7/+13
2024-02-12Clean inlined type alias with correct param-envMichael Goulet-1/+3
2024-02-12Improve some codes according to the reviewsFrank King-4/+0
- improve diagnostics of field uniqueness check and representation check - simplify the implementation of field uniqueness check - remove some useless codes and improvement neatness
2024-02-12Fix compile error in rustdoc.Frank King-9/+2
2024-02-12Lower anonymous structs or unions to HIRFrank King-0/+14
2024-02-11Auto merge of #120619 - compiler-errors:param, r=lcnrbors-21/+47
Assert that params with the same *index* have the same *name* Found this bug when trying to build libcore with the new solver, since it will canonicalize two params with the same index into *different* placeholders if those params differ by name.
2024-02-09Unify item relative path computation in one functionGuillaume Gomez-3/+16
2024-02-08Auto merge of #120767 - matthiaskrgr:rollup-0k8ib1c, r=matthiaskrgrbors-1/+1
Rollup of 9 pull requests Successful merges: - #119592 (resolve: Unload speculatively resolved crates before freezing cstore) - #120103 (Make it so that async-fn-in-trait is compatible with a concrete future in implementation) - #120206 (hir: Make sure all `HirId`s have corresponding HIR `Node`s) - #120214 (match lowering: consistently lower bindings deepest-first) - #120688 (GVN: also turn moves into copies with projections) - #120702 (docs: also check the inline stmt during redundant link check) - #120727 (exhaustiveness: Prefer "`0..MAX` not covered" to "`_` not covered") - #120734 (Add `SubdiagnosticMessageOp` as a trait alias.) - #120739 (improve pretty printing for associated items in trait objects) r? `@ghost` `@rustbot` modify labels: rollup
2024-02-08Auto merge of #120579 - GuillaumeGomez:prevent-running-unneeded-code, ↵bors-0/+8
r=notriddle Prevent running some code if it is already in the map I realized that a lot of duplicates were being run through this function. Might be better to prevent them from computing all the information if it's already in the cache. r? `@notriddle`
2024-02-07Use correct param env when building and cleaning items in librustdocMichael Goulet-21/+47
2024-02-07docs: also check the inline stmt during redundant link checkbohan-1/+1
2024-02-06Add CoroutineClosure to TyKind, AggregateKind, UpvarArgsMichael Goulet-0/+1
2024-02-04Prevent running some code if it is already in the mapGuillaume Gomez-0/+8
2024-02-01Fix handling of `doc_auto_cfg` feature for `cfg` attributes on glob reexportGuillaume Gomez-1/+1
2024-01-31Rollup merge of #120501 - GuillaumeGomez:glob-reexport-attr-merge-bugfix, ↵Nadrieril-1/+19
r=notriddle rustdoc: Correctly handle attribute merge if this is a glob reexport Fixes #120487. The regression was introduced in https://github.com/rust-lang/rust/pull/113091. Only non-glob reexports should have been impacted. cc `````@Nemo157````` r? `````@notriddle`````
2024-01-30rustdoc: Correctly handle attribute merge if this is a glob reexportGuillaume Gomez-1/+19
2024-01-29Rollup merge of #120428 - petrochenkov:somehir2, r=compiler-errorsDylan DPC-1/+1
hir: Two preparatory changes for #120206 cc https://github.com/rust-lang/rust/pull/120206 r? ```@compiler-errors```
2024-01-29Stop using `String` for error codes.Nicholas Nethercote-2/+3
Error codes are integers, but `String` is used everywhere to represent them. Gross! This commit introduces `ErrCode`, an integral newtype for error codes, replacing `String`. It also introduces a constant for every error code, e.g. `E0123`, and removes the `error_code!` macro. The constants are imported wherever used with `use rustc_errors::codes::*`. With the old code, we have three different ways to specify an error code at a use point: ``` error_code!(E0123) // macro call struct_span_code_err!(dcx, span, E0123, "msg"); // bare ident arg to macro call \#[diag(name, code = "E0123")] // string struct Diag; ``` With the new code, they all use the `E0123` constant. ``` E0123 // constant struct_span_code_err!(dcx, span, E0123, "msg"); // constant \#[diag(name, code = E0123)] // constant struct Diag; ``` The commit also changes the structure of the error code definitions: - `rustc_error_codes` now just defines a higher-order macro listing the used error codes and nothing else. - Because that's now the only thing in the `rustc_error_codes` crate, I moved it into the `lib.rs` file and removed the `error_codes.rs` file. - `rustc_errors` uses that macro to define everything, e.g. the error code constants and the `DIAGNOSTIC_TABLES`. This is in its new `codes.rs` file.
2024-01-28hir: Use `InferArg` in `ArrayLen::Infer`Vadim Petrochenkov-1/+1
2024-01-19Pack the u128 in LitKind::IntJosh Stone-1/+1
2024-01-18Rollup merge of #119869 - oli-obk:track_errors2, r=matthewjasperMatthias Krüger-4/+4
replace `track_errors` usages with bubbling up `ErrorGuaranteed` more of the same as https://github.com/rust-lang/rust/pull/117449 (removing `track_errors`)
2024-01-17Make crate_inherent_impls fallible and stop using `track_errors` for itOli Scherer-4/+4
2024-01-17Add `PatKind::Err`Lieselotte-1/+3
2024-01-13Rollup merge of #119898 - compiler-errors:error-reporting, r=oli-obkMatthias Krüger-1/+0
Remove unused `ErrorReporting` variant from overflow handling r? oli-obk
2024-01-12Remove unused ErrorReporting variant from overflow handlingMichael Goulet-1/+0
2024-01-12Delegation implementation: step 1Bryanskiy-1/+1
2024-01-11Stop using `DiagnosticBuilder::buffer` in the parser.Nicholas Nethercote-2/+2
One consequence is that errors returned by `maybe_new_parser_from_source_str` now must be consumed, so a bunch of places that previously ignored those errors now cancel them. (Most of them explicitly dropped the errors before. I guess that was to indicate "we are explicitly ignoring these", though I'm not 100% sure.)
2024-01-10Auto merge of #119751 - nnethercote:error-api-fixes, r=oli-obkbors-2/+2
Diagnostic API fixes Some improvements to diagnostic APIs: improve some naming, use shortcuts in more places, and add a couple of missing methods. r? `@compiler-errors`
2024-01-10Rollup merge of #119769 - fmease:rustdoc-off-by-one-dyn-trait-def-gen-args, ↵Matthias Krüger-91/+99
r=GuillaumeGomez rustdoc: offset generic args of cross-crate trait object types when cleaning Fixes #119529. This PR contains several refactorings apart from the bug fix. Best reviewed commit by commit. r? GuillaumeGomez