summary refs log tree commit diff
path: root/compiler/rustc_middle/src/query/mod.rs
AgeCommit message (Collapse)AuthorLines
2024-06-20Only compute specializes query if specialization is enabled in the crate of ↵Michael Goulet-0/+5
the specialized impl (cherry picked from commit 4b188d9d667dfcc7ba4caf95e56cbb3a6697f292)
2024-06-06Revert "Rollup merge of #124976 - petrochenkov:usedcrates, r=oli-obk"Rémy Rakic-13/+4
This reverts commit eda4a35f365535af72118118a3597edf5a13c12d, reversing changes made to eb6b35b5bcb3c2a594cb29cd478aeb2893f49d30.
2024-06-03check_is_object_safe -> is_object_safeMichael Goulet-1/+1
2024-05-29Start implementing needs_async_drop and relatedDaria Sukhonina-8/+9
2024-05-26Give EarlyBinder a tcx parameterMichael Goulet-13/+13
We are gonna need it to uplift EarlyBinder
2024-05-24Use regular type equating instead of a custom queryOli Scherer-9/+0
2024-05-23Improve the doc of query associated_itemr0cky-1/+1
2024-05-22rustc: Use `tcx.used_crates(())` moreVadim Petrochenkov-4/+13
And explain when it should be used.
2024-04-30Give items related to issue 33140 a more meaningful nameLeón Orell Valerian Liehr-2/+4
2024-04-29Remove `extern crate rustc_macros` from `rustc_middle`.Nicholas Nethercote-0/+1
2024-04-23Auto merge of #123992 - compiler-errors:no-has-typeck-results, r=jackh726bors-4/+0
`has_typeck_results` doesnt need to be a query self-explanatory
2024-04-17has_typeck_results doesnt need to be a queryMichael Goulet-4/+0
2024-04-16Add simple async drop glue generationzetanumbers-0/+8
Explainer: https://zetanumbers.github.io/book/async-drop-design.html https://github.com/rust-lang/rust/pull/121801
2024-04-16Rollup merge of #123995 - compiler-errors:thir-hooks, r=oli-obkGuillaume Gomez-14/+0
Make `thir_tree` and `thir_flat` into hooks No need for them to be queries, since they are only called with `-Zunpretty`
2024-04-15Make thir_tree and thir_flat into hooksMichael Goulet-14/+0
2024-04-15Just use type_dependent_def_id to figure out what the method is for an exprMichael Goulet-3/+0
2024-04-11Auto merge of #122213 - estebank:issue-50195, r=oli-obk,estebankbors-0/+3
Provide suggestion to dereference closure tail if appropriate When encoutnering a case like ```rust use std::collections::HashMap; fn main() { let vs = vec![0, 0, 1, 1, 3, 4, 5, 6, 3, 3, 3]; let mut counts = HashMap::new(); for num in vs { let count = counts.entry(num).or_insert(0); *count += 1; } let _ = counts.iter().max_by_key(|(_, v)| v); ``` produce the following suggestion ``` error: lifetime may not live long enough --> $DIR/return-value-lifetime-error.rs:13:47 | LL | let _ = counts.iter().max_by_key(|(_, v)| v); | ------- ^ returning this value requires that `'1` must outlive `'2` | | | | | return type of closure is &'2 &i32 | has type `&'1 (&i32, &i32)` | help: dereference the return value | LL | let _ = counts.iter().max_by_key(|(_, v)| **v); | ++ ``` Fix #50195.
2024-04-05Provide suggestion to dereference closure tail if appropriateEsteban Küber-0/+3
When encoutnering a case like ```rust //@ run-rustfix use std::collections::HashMap; fn main() { let vs = vec![0, 0, 1, 1, 3, 4, 5, 6, 3, 3, 3]; let mut counts = HashMap::new(); for num in vs { let count = counts.entry(num).or_insert(0); *count += 1; } let _ = counts.iter().max_by_key(|(_, v)| v); ``` produce the following suggestion ``` error: lifetime may not live long enough --> $DIR/return-value-lifetime-error.rs:13:47 | LL | let _ = counts.iter().max_by_key(|(_, v)| v); | ------- ^ returning this value requires that `'1` must outlive `'2` | | | | | return type of closure is &'2 &i32 | has type `&'1 (&i32, &i32)` | help: dereference the return value | LL | let _ = counts.iter().max_by_key(|(_, v)| **v); | ++ ``` Fix #50195.
2024-04-04cache type info for ParamEnvLukas Markeffsky-4/+4
2024-04-03Remove MIR unsafe checkMatthew Jasper-6/+0
This also remove safety information from MIR.
2024-03-26Remove `CacheSelector` trait now that we can use GATsOli Scherer-1/+1
2024-03-25Auto merge of #122721 - oli-obk:merge_queries, r=davidtwcobors-11/+5
Replace `mir_built` query with a hook and use mir_const everywhere instead A small perf improvement due to less dep graph handling. Mostly just a cleanup to get rid of one of our many mir queries
2024-03-22Rollup merge of #122784 - jswrenn:tag_for_variant, r=compiler-errorsMatthias Krüger-0/+7
Add `tag_for_variant` query This query allows for sharing code between `rustc_const_eval` and `rustc_transmutability`. It's a precursor to a PR I'm working on to entirely replace the bespoke layout computations in `rustc_transmutability`. r? `@compiler-errors`
2024-03-22Add `tag_for_variant` queryJack Wrenn-0/+7
This query allows for sharing code between `rustc_const_eval` and `rustc_transmutability`. Also moves `DummyMachine` to `rustc_const_eval`.
2024-03-20Split item bounds and item super predicatesMichael Goulet-6/+26
2024-03-20Update documentationOli Scherer-4/+5
2024-03-20Rename mir_const query to mir_builtOli Scherer-1/+1
2024-03-20Replace `mir_built` query with a hook and use mir_const everywhere insteadOli Scherer-7/+0
2024-03-18address nitsLukas Markeffsky-1/+1
2024-03-14clean up ADT sized constraint computationLukas Markeffsky-2/+2
2024-03-13Create some minimal HIR for associated opaque typesVadim Petrochenkov-4/+4
2024-03-12Ensure nested allocations in statics do not get deduplicatedOli Scherer-0/+2
2024-03-09Auto merge of #122010 - oli-obk:intrinsics3.0, r=pnkfelixbors-1/+1
Avoid invoking the `intrinsic` query for DefKinds other than `Fn` or `AssocFn` fixes the perf regression from https://github.com/rust-lang/rust/pull/120675 by only invoking (and thus inserting into the dep graph) the `intrinsic` query if the `DefKind` matches items that can actually be intrinsics
2024-03-08Auto merge of #121500 - oli-obk:track_errors12, r=petrochenkovbors-4/+1
Merge `collect_mod_item_types` query into `check_well_formed` follow-up to https://github.com/rust-lang/rust/pull/121154 this removes more potential parallel-compiler bottlenecks and moves diagnostics for the same items next to each other, instead of grouping diagnostics by analysis kind
2024-03-07Rollup merge of #121089 - oli-obk:create_def_feed, r=petrochenkovGuillaume Gomez-3/+1
Remove `feed_local_def_id` best reviewed commit by commit Basically I returned `TyCtxtFeed` from `create_def` and then preserved that in the local caches based on https://github.com/rust-lang/rust/pull/121084 r? ````@petrochenkov````
2024-03-07Merge collect_mod_item_types query into check_well_formedOli Scherer-4/+1
2024-03-07Apply `EarlyBinder` only to `TraitRef` in `ImplTraitHeader`Yoshitomo Nakanishi-1/+1
2024-03-07Merge `check_mod_impl_wf` and `check_mod_type_wf`Oli Scherer-5/+0
2024-03-06Rollup merge of #122027 - compiler-errors:rpitit-cycle, r=spastorinoMatthias Krüger-2/+2
Uplift some feeding out of `associated_type_for_impl_trait_in_impl` and into queries This PR moves the `type_of` and `generics_of` query feeding out of `associated_type_for_impl_trait_in_impl`, since eagerly feeding results in query cycles due to a subtle interaction with `resolve_bound_vars`. Fixes #122019 r? spastorino
2024-03-05Merge `impl_trait_in_assoc_types_defined_by` query back into ↵Oli Scherer-9/+0
`opaque_types_defined_by` Instead, when we're collecting opaques for associated items, we choose the right collection mode depending on whether we're collecting for an associated item of a trait impl or not.
2024-03-05Uplift some feeding out of associated_type_for_impl_trait_in_impl and into ↵Michael Goulet-2/+2
queries
2024-03-05Avoid using feed_unit_query from within queriesOli Scherer-2/+1
2024-03-05Remove a use of feed_local_crate and make it fail if used within queriesOli Scherer-1/+0
2024-03-05Avoid invoking the `intrinsic` query for DefKinds other than `Fn` or `AssocFn`Oli Scherer-1/+1
2024-03-04Return a struct from `query intrinsic` to be able to add another field in ↵Oli Scherer-1/+1
the next commit
2024-02-20Rollup merge of #121344 - fmease:lta-constr-by-input, r=oli-obkMatthias Krüger-10/+22
Expand weak alias types before collecting constrained/referenced late bound regions + refactorings Fixes #114220. Follow-up to #120780. r? `@oli-obk`
2024-02-20Rename some normalization-related itemsLeón Orell Valerian Liehr-10/+22
2024-02-18resolve: Scale back unloading of speculatively loaded cratesVadim Petrochenkov-0/+7
2024-02-16Auto merge of #120500 - oli-obk:intrinsics2.0, r=WaffleLapkinbors-2/+2
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-15Return ConstAllocation from eval_static_initializer query directlyOli Scherer-1/+1