about summary refs log tree commit diff
path: root/compiler/rustc_query_impl
AgeCommit message (Collapse)AuthorLines
2025-09-08fixup limit handling codeJana Dönszelmann-2/+1
2025-09-05DynamicConfig: use canonical clone implMarijn Schouten-1/+1
2025-09-02Revert introduction of `[workspace.dependencies]`.Nicholas Nethercote-2/+2
This was done in #145740 and #145947. It is causing problems for people using r-a on anything that uses the rustc-dev rustup package, e.g. Miri, clippy. This repository has lots of submodules and subtrees and various different projects are carved out of pieces of it. It seems like `[workspace.dependencies]` will just be more trouble than it's worth.
2025-08-28Add `measureme` to `[workspace.dependencies]`.Nicholas Nethercote-1/+1
2025-08-27Add `tracing` to `[workspace.dependencies]`.Nicholas Nethercote-1/+1
2025-07-07Remove unused allow attrsYotam Ofek-1/+0
2025-07-04Reuse metadata file from work products.Camille GILLOT-0/+11
2025-06-25Add new self-profile event for aggregating query hit countsJakub Beránek-0/+1
2025-05-01Auto merge of #140145 - Zoxc:job-server-proxy, r=SparrowLiibors-0/+6
Add a jobserver proxy to ensure at least one token is always held This adds a jobserver proxy to ensure at least one token is always held by `rustc`. Currently with `-Z threads` `rustc` can temporarily give up all its tokens, causing `cargo` to spawn additional `rustc` instances beyond the job limit. The current behavior causes an issue with `cargo fix` which has a global lock preventing concurrent `rustc` instances, but it also holds a jobserver token, causing a deadlock when `rustc` gives up its token. That is fixed by this PR. Fixes https://github.com/rust-lang/rust/issues/67385. Fixes https://github.com/rust-lang/rust/issues/133873. Fixes https://github.com/rust-lang/rust/issues/140093.
2025-04-29Reformat parameters to macros used by with-all-queriesZalathar-2/+5
2025-04-29Rename `rustc_query_append!` to `rustc_with_all_queries!`Zalathar-2/+2
2025-04-29Add a jobserver proxy to ensure at least one token is always heldJohn Kåre Alsaker-0/+6
2025-04-14Auto merge of #124141 - ↵bors-1/+0
nnethercote:rm-Nonterminal-and-TokenKind-Interpolated, r=petrochenkov Remove `Nonterminal` and `TokenKind::Interpolated` A third attempt at this; the first attempt was #96724 and the second was #114647. r? `@ghost`
2025-04-02Add a dep kind for use of the anon node with zero dependenciesJohn Kåre Alsaker-0/+11
2025-04-02Remove `recursion_limit` increases.Nicholas Nethercote-1/+0
These are no longer needed now that `Nonterminal` is gone.
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-24Auto merge of #138629 - Zoxc:graph-anon-hashmap, r=oli-obkbors-0/+4
Only use the new node hashmap for anonymous nodes This is a rebase of https://github.com/rust-lang/rust/pull/112469. cc `@cjgillot`
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-20Use `-Wunused_crate_dependencies` for compiler crates.Nicholas Nethercote-2/+0
It's very useful. There are some false positives involving integration tests in `rustc_pattern_analysis` and `rustc_serialize`. There is also a false positive involving `rustc_driver_impl`'s `rustc_randomized_layouts` feature. And I removed a `rustc_span` mention in a doc comment in `rustc_log` because it wasn't integral to the comment but caused a dev-dependency.
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-16Auto merge of #137011 - LuuuXXX:promote-ohos-with-host-tools, r=Amanieubors-2/+1
Promote ohos targets to tier2 with host tools. ### What does this PR try to resolve? Try to promote the following [[Tier 2 without Host Tools](https://doc.rust-lang.org/rustc/platform-support.html#tier-2-without-host-tools)](https://doc.rust-lang.org/rustc/platform-support.html#tier-2-without-host-tools) targets to [[Tier 2 with Host Tools](https://doc.rust-lang.org/rustc/platform-support.html#tier-2-with-host-tools)](https://doc.rust-lang.org/rustc/platform-support.html#tier-2-with-host-tools): - `aarch64-unknown-linux-ohos` - `armv7-unknown-linux-ohos` - `x86_64-unknown-linux-ohos` ### More Information? see MCP: https://github.com/rust-lang/compiler-team/issues/811 ### Blockage to be solved? - [x] Submit an MCP - [x] Submit code of promote ohos targets - [x] Resolve related dependencies (`measureme`) The modified code of the measureme has been merged (see https://github.com/rust-lang/measureme/pull/238). [done] The new version will was released (https://github.com/rust-lang/measureme/pull/240). [done]
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)-3/+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-08Specify rust lints for `compiler/` crates via Cargo.Nicholas Nethercote-0/+3
By naming them in `[workspace.lints.rust]` in the top-level `Cargo.toml`, and then making all `compiler/` crates inherit them with `[lints] workspace = true`. (I omitted `rustc_codegen_{cranelift,gcc}`, because they're a bit different.) The advantages of this over the current approach: - It uses a standard Cargo feature, rather than special handling in bootstrap. So, easier to understand, and less likely to get accidentally broken in the future. - It works for proc macro crates. It's a shame it doesn't work for rustc-specific lints, as the comments explain.
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-03-04use measureme-12.0.1LuuuXXX-2/+1
2025-03-04promote ohos targets to tier to with host toolsLuuuXXX-2/+2
2025-02-24Introduce new parsing infrastructure and types for parsed attributesJana Dönszelmann-0/+1
fixup docs in parser
2025-02-22Upgrade the compiler to edition 2024Michael Goulet-1/+1
2025-02-16Move hashes from rustc_data_structure to rustc_hashes so they can be shared ↵Ben Kimock-1/+3
with rust-analyzer
2025-02-05Removed dependency on the field-offset crate.David Venhoek-6/+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-27Rollup merge of #132410 - bjorn3:yet_another_driver_refactor_round, r=cjgillotMatthias Krüger-0/+8
Some more refactorings towards removing driver queries Follow up to https://github.com/rust-lang/rust/pull/127184 ## Custom driver breaking change The `after_analysis` callback is changed to accept `TyCtxt` instead of `Queries`. The only safe query in `Queries` to call at this point is `global_ctxt()` which allows you to enter the `TyCtxt` either way. To fix your custom driver, replace the `queries: &'tcx Queries<'tcx>` argument with `tcx: TyCtxt<'tcx>` and remove your `queries.global_ctxt().unwrap().enter(|tcx| { ... })` call and only keep the contents of the closure. ## Custom driver deprecation The `after_crate_root_parsing` callback is now deprecated. Several custom drivers are incorrectly calling `queries.global_ctxt()` from inside of it, which causes some driver code to be skipped. As such I would like to either remove it in the future or if custom drivers still need it, change it to accept an `&rustc_ast::Crate` instead.
2024-11-12Delete the `cfg(not(parallel))` serial compilerNoratrieb-5/+0
Since it's inception a long time ago, the parallel compiler and its cfgs have been a maintenance burden. This was a necessary evil the allow iteration while not degrading performance because of synchronization overhead. But this time is over. Thanks to the amazing work by the parallel working group (and the dyn sync crimes), the parallel compiler has now been fast enough to be shipped by default in nightly for quite a while now. Stable and beta have still been on the serial compiler, because they can't use `-Zthreads` anyways. But this is quite suboptimal: - the maintenance burden still sucks - we're not testing the serial compiler in nightly Because of these reasons, it's time to end it. The serial compiler has served us well in the years since it was split from the parallel one, but it's over now. Let the knight slay one head of the two-headed dragon!
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