summary refs log tree commit diff
path: root/compiler/rustc_query_system
AgeCommit message (Collapse)AuthorLines
2022-10-23Migrate all diagnosticsNilstrieb-15/+15
2022-10-14Remove the `describe` method from the `QueryDescription` traitnils-2/+0
It was called directly already, but now it's even more useless since it just forwards to the free function. Call it directly.
2022-10-10query_system: finish migrationDavid Wood-12/+5
Using eager translation, migrate the remaining repeated cycle stack diagnostic. Signed-off-by: David Wood <david.wood@huawei.com>
2022-10-10errors: `AddToDiagnostic::add_to_diagnostic_with`David Wood-2/+5
`AddToDiagnostic::add_to_diagnostic_with` is similar to the previous `AddToDiagnostic::add_to_diagnostic` but takes a function that can be used by the caller to modify diagnostic messages originating from the subdiagnostic (such as performing translation eagerly). `add_to_diagnostic` now just calls `add_to_diagnostic_with` with an empty closure. Signed-off-by: David Wood <david.wood@huawei.com>
2022-10-07Rewrite representabilityCameron Steffen-11/+20
2022-10-06Auto merge of #99324 - reez12g:issue-99144, r=jyn514bors-1/+0
Enable doctests in compiler/ crates Helps with https://github.com/rust-lang/rust/issues/99144
2022-10-01Allow query system to recover a HirId.Camille GILLOT-1/+5
2022-09-30create def ids for impl traits during ast loweringSantiago Pastorino-2/+2
2022-09-29Remove from compiler/ cratesreez12g-1/+0
2022-09-26remove cfg(bootstrap)Pietro Albini-1/+0
2022-09-25Move the `codegen_unit` debug assert from `rustc_query_system` to `query_impl`Joshua Nelson-20/+0
This allows removing a function from the `DepKind` trait.
2022-09-25Move some more code from rustc_middle to rustc_query_systemJoshua Nelson-0/+12
2022-09-25Move functions on `DepKindStruct` from rustc_middle to rustc_query_systemJoshua Nelson-5/+52
2022-09-25Move `DepKindStruct` from rustc_middle to rustc_query_systemJoshua Nelson-1/+62
2022-09-24separate definitions and `HIR` ownersTakayuki Maeda-2/+5
fix a ui test use `into` fix clippy ui test fix a run-make-fulldeps test implement `IntoQueryParam<DefId>` for `OwnerId` use `OwnerId` for more queries change the type of `ParentOwnerIterator::Item` to `(OwnerId, OwnerNode)`
2022-09-22Revert "Auto merge of #101620 - cjgillot:compute_lint_levels_by_def, r=oli-obk"Camille GILLOT-5/+1
This reverts commit 2cb9a65684dba47c52de8fa938febf97a73e70a9, reversing changes made to 750bd1a7ff3e010611b97ee75d30b7cbf5f3a03c.
2022-09-21FIX - adopt new Diagnostic naming in newly migrated modulesJhonny Bill Mena-2/+2
FIX - ambiguous Diagnostic link in docs UPDATE - rename diagnostic_items to IntoDiagnostic and AddToDiagnostic [Gardening] FIX - formatting via `x fmt` FIX - rebase conflicts. NOTE: Confirm wheather or not we want to handle TargetDataLayoutErrorsWrapper this way DELETE - unneeded allow attributes in Handler method FIX - broken test FIX - Rebase conflict UPDATE - rename residual _SessionDiagnostic and fix LintDiag link
2022-09-21UPDATE - rename SessionSubdiagnostic macro to SubdiagnosticJhonny Bill Mena-3/+4
Also renames: - sym::AddSubdiagnostic to sym:: Subdiagnostic - rustc_diagnostic_item = "AddSubdiagnostic" to rustc_diagnostic_item = "Subdiagnostic"
2022-09-21UPDATE - rename DiagnosticHandler macro to DiagnosticJhonny Bill Mena-3/+3
2022-09-21UPDATE - rename DiagnosticHandler trait to IntoDiagnosticJhonny Bill Mena-8/+8
2022-09-21UPDATE - move SessionDiagnostic from rustc_session to rustc_errorsJhonny Bill Mena-2/+4
2022-09-17Rollup merge of #101801 - SparrowLii:query_depth_note, r=estebankMatthias Krüger-7/+42
add note for `layout_of` when query depth overflows Fixes #101747 Added `try_find_layout_root` function to add a note for `layout_of` when query depth overflows. This would make the error in #101747 look like this: ``` error: queries overflow the depth limit! | note: Query depth increased by 66 when computing layout of `core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<core::option::Option<alloc::boxed::Box<alloc::string::String>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>`! --> D:\rust-backup\parallel_rust\query_depth.rs:40:1 | 40 | fn main() { | ^^^^^^^^^ error: aborting due to previous error ``` cc ``@semicoleon``
2022-09-15Only enable the let_else feature on bootstrapest31-1/+1
On later stages, the feature is already stable. Result of running: rg -l "feature.let_else" compiler/ src/librustdoc/ library/ | xargs sed -s -i "s#\\[feature.let_else#\\[cfg_attr\\(bootstrap, feature\\(let_else\\)#"
2022-09-15correct span, add help message and add UI test when query depth overflowsSparrowLii-22/+12
2022-09-15add note for `layout_of` when query depth overflowsSparrowLii-4/+49
2022-09-14Allow query system to recover a HirId.Camille GILLOT-1/+5
2022-09-09Remove unnecessary `TRY_LOAD_FROM_DISK` constantJoshua Nelson-4/+1
2022-09-09Remove `cache_on_disk` from `QueryVTable`Joshua Nelson-11/+5
This is not only simpler, but removes a generic function and unwrap. I have hope it will see compile time and bootstrap time improvements.
2022-09-08Rollup merge of #101549 - eholk:type-ir-derive-hashstable_generic, r=jackh726Dylan DPC-0/+3
Use HashStable_Generic in rustc_type_ir A lot of the types in this crate implemented HashStable directly to avoid circular dependencies. One way around that is to use HashStable_Generic. We adopt that here to avoid a lot of boilerplate. This doesn't update all the types, because some would require `I: Interner + HashStable`. r? `@cjgillot`
2022-09-08Auto merge of #101303 - jyn514:jnelson/handle-cycle-enum, r=cjgillotbors-5/+63
Make `HandleCycleError` an enum instead of a macro-generated closure Helps with https://github.com/rust-lang/rust/issues/96524. Based on https://github.com/rust-lang/rust/pull/100943 to avoid merge conflicts, so it looks larger than it is (only the last commit is relevant). cc https://rust-lang.zulipchat.com/#narrow/stream/241847-t-compiler.2Fwg-incr-comp/topic/Moving.20.60Value.60.20to.20rustc_query_system.20.2396524 r? `@cjgillot`
2022-09-07Use HashStable_Generic in rustc_type_irEric Holk-0/+3
A lot of the types in this crate implemented HashStable directly to avoid circular dependencies. One way around that is to use HashStable_Generic. We adopt that here to avoid a lot of boilerplate. This doesn't update all the types, because some would require `I: Interner + HashStable`.
2022-09-06Make `HandleCycleError` an enum instead of a macro-generated closureJoshua Nelson-5/+63
- Add a `HandleCycleError` enum to rustc_query_system, along with a `handle_cycle_error` function - Move `Value` to rustc_query_system, so `handle_cycle_error` can use it - Move the `Value` impls from rustc_query_impl to rustc_middle. This is necessary due to orphan rules.
2022-09-05UPDATE - into_diagnostic to take a Handler instead of a ParseSessJhonny Bill Mena-1/+1
Suggested by the team in this Zulip Topic https://rust-lang.zulipchat.com/#narrow/stream/336883-i18n/topic/.23100717.20SessionDiagnostic.20on.20Handler Handler already has almost all the capabilities of ParseSess when it comes to diagnostic emission, in this migration we only needed to add the ability to access source_map from the emitter in order to get a Snippet and the start_point. Not sure if this is the best way to address this gap
2022-09-01Don't create two new closures for each queryJoshua Nelson-0/+3
- Parameterize DepKindStruct over `'tcx` This allows passing in an invariant function pointer in `query_callback`, rather than having to try and make it work for any lifetime. - Add a new `execute_query` function to `QueryDescription` so we can call `tcx.$name` without needing to be in a macro context
2022-09-01Auto merge of #100869 - nnethercote:replace-ThinVec, r=spastorinobors-6/+6
Replace `rustc_data_structures::thin_vec::ThinVec` with `thin_vec::ThinVec` `rustc_data_structures::thin_vec::ThinVec` looks like this: ``` pub struct ThinVec<T>(Option<Box<Vec<T>>>); ``` It's just a zero word if the vector is empty, but requires two allocations if it is non-empty. So it's only usable in cases where the vector is empty most of the time. This commit removes it in favour of `thin_vec::ThinVec`, which is also word-sized, but stores the length and capacity in the same allocation as the elements. It's good in a wider variety of situation, e.g. in enum variants where the vector is usually/always non-empty. The commit also: - Sorts some `Cargo.toml` dependency lists, to make additions easier. - Sorts some `use` item lists, to make additions easier. - Changes `clean_trait_ref_with_bindings` to take a `ThinVec<TypeBinding>` rather than a `&[TypeBinding]`, because this avoid some unnecessary allocations. r? `@spastorino`
2022-08-31SessionDiagnostic for QueryOverflow errorLi Yuanheng-1/+5
2022-08-31delete leftover commentLi Yuanheng-1/+0
2022-08-31use derive proc macro to impl SessionDiagnosticYuanheng Li-53/+79
fixes `SessionSubdiagnostic` to accept multiple attributes emitting list of fluent message remains unresolved
2022-08-31link related issue to FIXMELi Yuanheng-1/+1
Co-authored-by: David Wood <agile.lion3441@fuligin.ink>
2022-08-31migrate rustc_query_system to use SessionDiagnosticYuanheng Li-46/+86
with manual impl SessionDiagnostic
2022-08-29Replace `rustc_data_structures::thin_vec::ThinVec` with `thin_vec::ThinVec`.Nicholas Nethercote-6/+6
`rustc_data_structures::thin_vec::ThinVec` looks like this: ``` pub struct ThinVec<T>(Option<Box<Vec<T>>>); ``` It's just a zero word if the vector is empty, but requires two allocations if it is non-empty. So it's only usable in cases where the vector is empty most of the time. This commit removes it in favour of `thin_vec::ThinVec`, which is also word-sized, but stores the length and capacity in the same allocation as the elements. It's good in a wider variety of situation, e.g. in enum variants where the vector is usually/always non-empty. The commit also: - Sorts some `Cargo.toml` dependency lists, to make additions easier. - Sorts some `use` item lists, to make additions easier. - Changes `clean_trait_ref_with_bindings` to take a `ThinVec<TypeBinding>` rather than a `&[TypeBinding]`, because this avoid some unnecessary allocations.
2022-08-24add `depth_limit` in `QueryVTable`SparrowLii-13/+23
2022-08-16Auto merge of #100441 - nnethercote:shrink-ast-Attribute, r=petrochenkovbors-3/+3
Shrink `ast::Attribute`. r? `@ghost`
2022-08-16Shrink `ast::Attribute`.Nicholas Nethercote-3/+3
2022-08-07Remove unused hashing infra.Camille GILLOT-22/+7
2022-08-07Derive HashStable for HIR Expr and Ty.Camille GILLOT-14/+0
2022-08-07Stop forcing the hashing of bodies in types and expressions.Camille GILLOT-14/+8
2022-07-29Remove useless closure.Camille GILLOT-5/+3
2022-07-28Remove guess_head_span.Camille GILLOT-6/+2
2022-07-20consistently use VTable over Vtable (matching stable stdlib API RawWakerVTable)Ralf Jung-10/+10