about summary refs log tree commit diff
path: root/compiler/rustc_query_impl/src/plumbing.rs
AgeCommit message (Collapse)AuthorLines
2025-09-08fixup limit handling codeJana Dönszelmann-1/+1
2025-07-04Reuse metadata file from work products.Camille GILLOT-0/+11
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-1/+1
2025-04-29Add a jobserver proxy to ensure at least one token is always heldJohn Kåre Alsaker-0/+6
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-33/+64
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-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-2/+2
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-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-5/+5
2024-08-29Add `warn(unreachable_pub)` to `rustc_query_impl`.Nicholas Nethercote-18/+26
2024-08-19Prevent double panic in query system, improve diagnosticsFelix Rath-2/+8
2024-07-29Reformat `use` declarations.Nicholas Nethercote-8/+10
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-05-13Remove `extern crate rustc_middle` from `rustc_query_impl`.Nicholas Nethercote-2/+3
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-03-12Verify that query keys result in unique dep nodesJohn Kåre Alsaker-0/+50
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/+2
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-06don't reexport atomic::ordering via rustc_data_structures, use std importklensy-1/+1
2023-12-26Auto merge of #119129 - jyn514:verbose, r=compiler-errors,estebankbors-2/+5
rework `-Zverbose` implements the changes described in https://github.com/rust-lang/compiler-team/issues/706 the first commit is only a name change from `-Zverbose` to `-Zverbose-internals` and does not change behavior. the second commit changes diagnostics. possible follow up work: - `ty::pretty` could print more info with `--verbose` than it does currently. `-Z verbose-internals` shows too much info in a way that's not helpful to users. michael had ideas about this i didn't fully understand: https://rust-lang.zulipchat.com/#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/uplift.20some.20-Zverbose.20calls.20and.20rename.20to.E2.80.A6.20compiler-team.23706/near/408984200 - `--verbose` should imply `-Z write-long-types-to-disk=no`. the code in `ty_string_with_limit` should take `--verbose` into account (apparently this affects `Ty::sort_string`, i'm not familiar with this code). writing a file to disk should suggest passing `--verbose`. r? `@compiler-errors` cc `@estebank`
2023-12-24Remove `Session` methods that duplicate `DiagCtxt` methods.Nicholas Nethercote-1/+1
Also add some `dcx` methods to types that wrap `TyCtxt`, for easier access.
2023-12-19rename to verbose-internalsjyn-2/+5
2023-11-27QueryContext: rename try_collect_active_jobs -> collect_active_jobs and ↵klensy-7/+7
change it's return type from Option<QueryMap> to QueryMap As there currently always Some(...) inside
2023-11-25rustc: Make `def_kind` mandatory for all `DefId`sVadim Petrochenkov-2/+2
2023-11-21Fix `clippy::needless_borrow` in the compilerNilstrieb-1/+1
`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-10-28Rollup merge of #116534 - cjgillot:no-dep-tasks, r=davidtwcoJubilee-2/+0
Remove -Zdep-tasks. This option is not useful any more, we can use `tracing` and `RUSTC_LOG` to debug the dep-graph.
2023-10-26Stash and cancel cycle errors for auto trait leakage in opaquesMichael Goulet-0/+3
2023-10-08Remove useless debugging.Camille GILLOT-2/+0
2023-09-21Move `DepKind` to `rustc_query_system` and define it as `u16`John Kåre Alsaker-13/+24
2023-09-10Remove `verbose_generic_activity_with_arg`John Kåre Alsaker-2/+1