summary refs log tree commit diff
path: root/compiler/rustc_middle/src/query
AgeCommit message (Collapse)AuthorLines
2023-12-18Replace some instances of FxHashMap/FxHashSet with stable alternatives ↵Michael Woerister-2/+2
(mostly in rustc_hir and rustc_ast_lowering) Part of https://github.com/rust-lang/compiler-team/issues/533
2023-12-13global param_env canonicalization cacheAli MJ Al-Nasrawy-1/+3
2023-12-07ctfe interpreter: extend provenance so that it can track whether a pointer ↵Ralf Jung-0/+1
is immutable
2023-12-02Rename `HandlerInner::delay_span_bug` as `HandlerInner::span_delayed_bug`.Nicholas Nethercote-4/+4
Because the corresponding `Level` is `DelayedBug` and `span_delayed_bug` follows the pattern used everywhere else: `span_err`, `span_warning`, etc.
2023-11-26Auto merge of #117301 - saethlin:finish-rmeta-encoding, r=WaffleLapkinbors-2/+1
Call FileEncoder::finish in rmeta encoding Fixes https://github.com/rust-lang/rust/issues/117254 The bug here was that rmeta encoding never called FileEncoder::finish. Now it does. Most of the changes here are needed to support that, since rmeta encoding wants to finish _then_ access the File in the encoder, so finish can't move out. I tried adding a `cfg(debug_assertions)` exploding Drop impl to FileEncoder that checked for finish being called before dropping, but fatal errors cause unwinding so this isn't really possible. If we encounter a fatal error with a dirty FileEncoder, the Drop impl ICEs even though the implementation is correct. If we try to paper over that by wrapping FileEncoder in ManuallyDrop then that just erases the fact that Drop automatically checks that we call finish on all paths. I also changed the name of DepGraph::encode to DepGraph::finish_encoding, because that's what it does and it makes the fact that it is the path to FileEncoder::finish less confusing. r? `@WaffleLapkin`
2023-11-25rustc: Make `def_kind` mandatory for all `DefId`sVadim Petrochenkov-18/+1
2023-11-23Move WorkerLocal out of QueryArenasMark Rousskov-4/+4
This cuts librustc_driver.so code size by ~85 kilobytes.
2023-11-22Call FileEncoder::finish in rmeta encodingBen Kimock-2/+1
2023-11-22Allow defining opaques in check_coroutine_obligationsMichael Goulet-1/+1
2023-11-21Fix `clippy::needless_borrow` in the compilerNilstrieb-8/+3
`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`. Then I had to remove a few unnecessary parens and muts that were exposed now.
2023-11-21Auto merge of #118107 - matthiaskrgr:rollup-k5bfkfr, r=matthiaskrgrbors-1/+11
Rollup of 8 pull requests Successful merges: - #117327 (Add documentation for some queries) - #117835 (Note about object lifetime defaults in does not live long enough error) - #117851 (Uplift `InferConst` to `rustc_type_ir`) - #117973 (test: Add test for async-move in 2015 Rust proc macro) - #117992 (Don't require intercrate mode for negative coherence) - #118010 (Typeck break expr even if break is illegal) - #118026 (Don't consider regions in `deref_into_dyn_supertrait` lint) - #118089 (intercrate_ambiguity_causes: handle self ty infer + reservation impls) r? `@ghost` `@rustbot` modify labels: rollup
2023-11-20Unify defined_lib_features and lib_features queriesMichael Goulet-5/+2
2023-11-19Add documentation for some queriesNilstrieb-1/+11
2023-11-08Rollup merge of #116399 - WaffleLapkin:erase_small_things, r=cjgillotMatthias Krüger-6/+16
Small changes w/ `query::Erase<_>` r? `@cjgillot` cc `@Zoxc`
2023-11-07Add an explanation for `transmute_unchecked`Maybe Waffle-0/+9
2023-10-31Turn const_caller_location from a query to a hookOli Scherer-4/+0
2023-10-26Stash and cancel cycle errors for auto trait leakage in opaquesMichael Goulet-0/+1
2023-10-25Rollup merge of #117136 - compiler-errors:defid-list, r=oli-obkMatthias Krüger-1/+1
Intern `LocalDefId` list from `opaque_types_defined_by` query r? oli-obk
2023-10-24Intern LocalDefId list from opaque queryMichael Goulet-1/+1
2023-10-23Auto merge of #116849 - oli-obk:error_shenanigans, r=cjgillotbors-6/+62
Avoid a `track_errors` by bubbling up most errors from `check_well_formed` I believe `track_errors` is mostly papering over issues that a sufficiently convoluted query graph can hit. I made this change, while the actual change I want to do is to stop bailing out early on errors, and instead use this new `ErrorGuaranteed` to invoke `check_well_formed` for individual items before doing all the `typeck` logic on them. This works towards resolving https://github.com/rust-lang/rust/issues/97477 and various other ICEs, as well as allowing us to use parallel rustc more (which is currently rather limited/bottlenecked due to the very sequential nature in which we do `rustc_hir_analysis::check_crate`) cc `@SparrowLii` `@Zoxc` for the new `try_par_for_each_in` function
2023-10-23Allow `ensure` queries to return `Result<(), ErrorGuaranteed>`Oli Scherer-4/+60
2023-10-21coverage: Change query `codegened_and_inlined_items` to a plain functionZalathar-6/+0
This query has a name that sounds general-purpose, but in fact it has coverage-specific semantics, and (fortunately) is only used by coverage code. Because it is only ever called once (from one designated CGU), it doesn't need to be a query, and we can change it to a regular function instead.
2023-10-20s/generator/coroutine/Oli Scherer-9/+9
2023-10-20s/Generator/Coroutine/Oli Scherer-4/+4
2023-10-20Avoid a `track_errors` by bubbling up most errors from `check_well_formed`Oli Scherer-2/+2
2023-10-18coverage: Store all of a function's mappings in function coverage infoZalathar-11/+0
Previously, mappings were attached to individual coverage statements in MIR. That necessitated special handling in MIR optimizations to avoid deleting those statements, since otherwise codegen would be unable to reassemble the original list of mappings. With this change, a function's list of mappings is now attached to its MIR body, and survives intact even if individual statements are deleted by optimizations.
2023-10-18coverage: Store the number of counters/expressions in function coverage infoZalathar-4/+5
Coverage codegen can now allocate arrays based on the number of counters/expressions originally used by the instrumentor. The existing query that inspects coverage statements is still used for determining the number of counters passed to `llvm.instrprof.increment`. If some high-numbered counters were removed by MIR optimizations, the instrumented binary can potentially use less memory and disk space at runtime.
2023-10-17Automatically enable cross-crate inlining for small functionsBen Kimock-0/+5
2023-10-03Use consisntent style of `size_of` in query type erasureMaybe Waffle-4/+4
All other impls replace type generics with `()` (or a type implementing the necessery traits) and lifetimes with `'static`, do the same for those impls.
2023-10-03Use `transmute_unchecked` and make the types explicit in query type erasureMaybe Waffle-3/+4
This doesn't really change anything, but makes the code a bit more explicit/readable.
2023-10-02remove another unused Key implRalf Jung-9/+0
2023-10-02remove Key impls for types that involve an AllocIdRalf Jung-24/+0
2023-09-26Don't store lazyness in DefKindMichael Goulet-1/+9
2023-09-23Enable drop_tracking_mir by default.Camille GILLOT-7/+0
2023-09-22Add a way to decouple the implementation and the declaration of a TyCtxt method.Oli Scherer-10/+0
2023-09-22Auto merge of #115920 - Zoxc:depkind-u16, r=cjgillotbors-5/+4
Move `DepKind` to `rustc_query_system` and define it as `u16` This moves the `DepKind` type to `rustc_query_system` where it's defined with an inner `u16` field. This decouples it from `rustc_middle` and is a step towards letting other crates define dep kinds. It also allows some type parameters to be removed. The `DepKind` trait is replaced with a `Deps` trait. That's used when some operations or information about dep kinds which is unavailable in `rustc_query_system` are still needed. r? `@cjgillot`
2023-09-21Record asyncness span in HIRMichael Goulet-1/+2
2023-09-21Move `DepKind` to `rustc_query_system` and define it as `u16`John Kåre Alsaker-5/+4
2023-09-21rename mir::Constant -> mir::ConstOperand, mir::ConstKind -> mir::ConstRalf Jung-6/+5
2023-09-19move ConstValue into mirRalf Jung-17/+12
this way we have mir::ConstValue and ty::ValTree as reasonably parallel
2023-09-10Cache reachable_set on diskTomasz Miąsko-0/+1
2023-09-09Auto merge of #115657 - Zoxc:source-span-avoid-query, r=cjgillotbors-1/+1
Avoid a `source_span` query when encoding Spans into query results This avoids a `source_span` query when encoding `Span`s into query results. It's not sound to execute queries here as the query caches can be locked and the dep graph is no longer writable. r? `@cjgillot`
2023-09-08Avoid a `source_span` query when encoding Spans into query resultsJohn Kåre Alsaker-1/+1
2023-09-07Use `Freeze` for `SourceFile.lines`John Kåre Alsaker-1/+1
2023-09-03Use relative positions inside a SourceFile.Camille GILLOT-2/+3
2023-08-27More precisely detect cycle errors from type_of on opaqueMichael Goulet-1/+19
2023-08-27Pass ErrorGuaranteed to cycle errorMichael Goulet-2/+3
2023-08-16Auto merge of #114536 - cjgillot:eval-lint-levels, r=TaKO8Kibors-1/+0
Do not mark shallow_lint_levels_on as eval_always. It does not need it. Removing it allows to skip recomputation.
2023-08-15Rollup merge of #114772 - fee1-dead-contrib:typed-did, r=b-naberGuillaume Gomez-16/+74
Add `{Local}ModDefId` to more strongly type DefIds` Based on #110862 by `@Nilstrieb`
2023-08-14Use `{Local}ModDefId` in many queriesNilstrieb-16/+74