about summary refs log tree commit diff
path: root/compiler/rustc_query_impl/src
AgeCommit message (Collapse)AuthorLines
2025-04-02Add a dep kind for use of the anon node with zero dependenciesJohn Kåre Alsaker-0/+11
2025-03-26Use a function to create `QueryStackDeferred` to ensure context is CopyJohn Kåre Alsaker-33/+41
2025-03-26Avoiding calling queries when collecting active queriesJohn Kåre Alsaker-37/+71
2025-03-25Rollup merge of #138581 - Zoxc:abort-handler-if-locked, r=SparrowLiiMatthias Krüger-6/+18
Abort in deadlock handler if we fail to get a query map Resolving query cycles requires the complete active query map, or it may miss query cycles. We did not check that the map is completely constructed before. If there is some error collecting the map, something has gone wrong already. This adds a check to abort/panic if we fail to construct the complete map. This can help differentiate errors from the `deadlock detected` case if constructing query map has errors in practice. An `Option` is not used for `collect_active_jobs` as the panic handler can still make use of a partial map.
2025-03-21Address commentsJohn Kåre Alsaker-9/+16
2025-03-21Update commentsJohn Kåre Alsaker-0/+2
2025-03-21Abort in deadlock handler if we fail to get a query mapJohn Kåre Alsaker-6/+9
2025-03-19Pass in dep kind names to the duplicate dep node checkJohn Kåre Alsaker-0/+4
2025-03-19Auto merge of #122156 - Zoxc:side-effect-dep-node, r=oli-obkbors-28/+26
Represent diagnostic side effects as dep nodes This changes diagnostic to be tracked as a special dep node (`SideEffect`) instead of having a list of side effects associated with each dep node. `SideEffect` is always red and when forced, it emits the diagnostic and marks itself green. Each emitted diagnostic generates a new `SideEffect` with an unique dep node index. Some implications of this: - Diagnostic may now be emitted more than once as they can be emitted once when the `SideEffect` gets marked green and again if the task it depends on needs to be re-executed due to another node being red. It relies on deduplicating of diagnostics to avoid that. - Anon tasks which emits diagnostics will no longer *incorrectly* be merged with other anon tasks. - Reusing a CGU will now emit diagnostics from the task generating it.
2025-03-15Move codec module back into middleMichael Goulet-1/+2
2025-03-14Rename `QuerySideEffects` to `QuerySideEffect`John Kåre Alsaker-6/+6
2025-03-14Represent diagnostic side effects as dep nodesJohn Kåre Alsaker-25/+23
2025-03-12Auto merge of #138414 - matthiaskrgr:rollup-9ablqdb, r=matthiaskrgrbors-1/+0
Rollup of 7 pull requests Successful merges: - #137314 (change definitely unproductive cycles to error) - #137701 (Convert `ShardedHashMap` to use `hashbrown::HashTable`) - #138269 (uefi: fs: Implement FileType, FilePermissions and FileAttr) - #138331 (Use `RUSTC_LINT_FLAGS` more) - #138345 (Some autodiff cleanups) - #138387 (intrinsics: remove unnecessary leading underscore from argument names) - #138390 (fix incorrect tracing log) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-11Remove `#![warn(unreachable_pub)]` from all `compiler/` crates.Nicholas Nethercote-1/+0
It's no longer necessary now that `-Wunreachable_pub` is being passed.
2025-03-10Revert "Use workspace lints for crates in `compiler/` #138084"许杰友 Jieyou Xu (Joe)-0/+1
Revert <https://github.com/rust-lang/rust/pull/138084> to buy time to consider options that avoids breaking downstream usages of cargo on distributed `rustc-src` artifacts, where such cargo invocations fail due to inability to inherit `lints` from workspace root manifest's `workspace.lints` (this is only valid for the source rust-lang/rust workspace, but not really the distributed `rustc-src` artifacts). This breakage was reported in <https://github.com/rust-lang/rust/issues/138304>. This reverts commit 48caf81484b50dca5a5cebb614899a3df81ca898, reversing changes made to c6662879b27f5161e95f39395e3c9513a7b97028.
2025-03-08Remove `#![warn(unreachable_pub)]` from all `compiler/` crates.Nicholas Nethercote-1/+0
(Except for `rustc_codegen_cranelift`.) It's no longer necessary now that `unreachable_pub` is in the workspace lints.
2025-03-07Increase recursion_limit in numerous crates.Nicholas Nethercote-0/+1
This is temporarily needed for `x doc compiler` to work. They can be removed once the `Nonterminal` is removed (#124141).
2025-02-16Move hashes from rustc_data_structure to rustc_hashes so they can be shared ↵Ben Kimock-1/+2
with rust-analyzer
2025-02-05Removed dependency on the field-offset crate.David Venhoek-5/+16
2025-02-03Remove hook calling via `TyCtxtAt`.Nicholas Nethercote-3/+2
All hooks receive a `TyCtxtAt` argument. Currently hooks can be called through `TyCtxtAt` or `TyCtxt`. In the latter case, a `TyCtxtAt` is constructed with a dummy span and passed to the hook. However, in practice hooks are never called through `TyCtxtAt`, and always receive a dummy span. (I confirmed this via code inspection, and double-checked it by temporarily making the `TyCtxtAt` code path panic and running all the tests.) This commit removes all the `TyCtxtAt` machinery for hooks. All hooks now receive `TyCtxt` instead of `TyCtxtAt`. There are two existing hooks that use `TyCtxtAt::span`: `const_caller_location_provider` and `try_destructure_mir_constant_for_user_output`. For both hooks the span is always a dummy span, probably unintentionally. This dummy span use is now explicit. If a non-dummy span is needed for these two hooks it would be easy to add it as an extra argument because hooks are less constrained than queries.
2025-01-07don't return an Option from try_find_dep_kindMartin Zacho-8/+3
2025-01-06improve diagnostics for const eval query overflowMartin Zacho-7/+5
2024-12-13Rename ty_def_id so people will stop using it by accidentMichael Goulet-2/+2
2024-12-06Remove 'tcx lifetime from OnDiskCachebjorn3-3/+3
2024-11-09Move some code from Compiler::enter to GlobalCtxt::finishbjorn3-0/+8
2024-10-03Handle `rustc_query_impl` cases of `rustc::potential_query_instability` lintismailarilik-1/+1
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-12/+12
2024-09-13Rename and reorder lots of lifetimes.Nicholas Nethercote-7/+7
- Replace non-standard names like 's, 'p, 'rg, 'ck, 'parent, 'this, and 'me with vanilla 'a. These are cases where the original name isn't really any more informative than 'a. - Replace names like 'cx, 'mir, and 'body with vanilla 'a when the lifetime applies to multiple fields and so the original lifetime name isn't really accurate. - Put 'tcx last in lifetime lists, and 'a before 'b.
2024-08-29Add `warn(unreachable_pub)` to `rustc_query_impl`.Nicholas Nethercote-18/+27
2024-08-21Simplify some redundant field namesMichael Goulet-1/+1
2024-08-19Prevent double panic in query system, improve diagnosticsFelix Rath-2/+8
2024-07-29Reformat `use` declarations.Nicholas Nethercote-18/+20
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-06-19Allow tracing through item_bounds query invocations on opaquesOli Scherer-1/+3
Previously these caused cycles when printing the result
2024-06-12Use `tidy` to sort crate attributes for all compiler crates.Nicholas Nethercote-3/+5
We already do this for a number of crates, e.g. `rustc_middle`, `rustc_span`, `rustc_metadata`, `rustc_span`, `rustc_errors`. For the ones we don't, in many cases the attributes are a mess. - There is no consistency about order of attribute kinds (e.g. `allow`/`deny`/`feature`). - Within attribute kind groups (e.g. the `feature` attributes), sometimes the order is alphabetical, and sometimes there is no particular order. - Sometimes the attributes of a particular kind aren't even grouped all together, e.g. there might be a `feature`, then an `allow`, then another `feature`. This commit extends the existing sorting to all compiler crates, increasing consistency. If any new attribute line is added there is now only one place it can go -- no need for arbitrary decisions. Exceptions: - `rustc_log`, `rustc_next_trait_solver` and `rustc_type_ir_macros`, because they have no crate attributes. - `rustc_codegen_gcc`, because it's quasi-external to rustc (e.g. it's ignored in `rustfmt.toml`).
2024-05-13Remove `extern crate rustc_middle` from `rustc_query_impl`.Nicholas Nethercote-6/+4
2024-05-08Simplify `use crate::rustc_foo::bar` occurrences.Nicholas Nethercote-4/+2
They can just be written as `use rustc_foo::bar`, which is far more standard. (I didn't even know that a `crate::` prefix was valid.)
2024-04-22Stabilize generic `NonZero`.Markus Reiter-1/+0
2024-04-11move QueryKeyStringCache from rustc_middle to rustc_query_impl, where it ↵klensy-4/+13
actually used also allows to drop measureme dep on rustc_middle
2024-03-12Verify that query keys result in unique dep nodesJohn Kåre Alsaker-1/+51
2024-03-04Avoid using unnecessary queries when printing the query stack in panicsJohn Kåre Alsaker-2/+7
2024-03-03Add a proper `with_no_queries` to printingJohn Kåre Alsaker-11/+4
2024-02-28Rename `Diagnostic` as `DiagInner`.Nicholas Nethercote-2/+2
I started by changing it to `DiagData`, but that didn't feel right. `DiagInner` felt much better.
2024-02-15Replace `NonZero::<_>::new` with `NonZero::new`.Markus Reiter-4/+2
2024-02-15Use generic `NonZero` internally.Markus Reiter-2/+3
2024-02-06Invert diagnostic lints.Nicholas Nethercote-2/+0
That is, change `diagnostic_outside_of_impl` and `untranslatable_diagnostic` from `allow` to `deny`, because more than half of the compiler has be converted to use translated diagnostics. This commit removes more `deny` attributes than it adds `allow` attributes, which proves that this change is warranted.
2024-01-25Remove unused featuresclubby789-2/+0
2024-01-09Rollup merge of #119527 - klensy:ordering, r=compiler-errorsGuillaume Gomez-1/+1
don't reexport atomic::ordering via rustc_data_structures, use std import This looks simpler.
2024-01-08Don't check for recursion in generator witness fieldsMichael Goulet-2/+2
2024-01-08Value recovery can take the whole CycleErrorMichael Goulet-3/+3
2024-01-06don't reexport atomic::ordering via rustc_data_structures, use std importklensy-1/+1