Commit Graph

51 Commits

Author SHA1 Message Date
John Kåre Alsaker 85967c4de4 Add a TaggedQueryKey to identify a query instance 2026-03-13 07:49:38 +01:00
John Kåre Alsaker 9f7d502d64 Remove deterministic picking from query cycle handling 2026-02-23 01:31:59 +01:00
Nicholas Nethercote 32e6a1a0ab Remove QueryContext.
`rustc_query_system` has been reduced so much that it's no longer
needed. This avoids a lot of indirection and abstraction.
2026-02-15 13:07:35 +11:00
Nicholas Nethercote a34317e5a5 Move report_cycle.
From `rustc_query_system::query::job` to `rustc_query_impl::job`.
2026-02-10 18:46:05 +11:00
Nicholas Nethercote 923de04f6a Move rustc_middle::query::values to rustc_query_impl.
Because all uses are now in `rustc_query_impl`. This was made possible
by the previous commit. Less code in `rustc_middle`, hooray.
2026-02-10 18:46:05 +11:00
Nicholas Nethercote 066a935b0c Move parts of rustc_query_system::query::job to rustc_middle::job.
The latter is a new module.

As well as the code motion, some other changes were required.
- `QueryJobId` methods became free functions so they could move while
  `QueryJobId` itself stayed put. This was so `QueryMap` and
  `QueryJobInfo` could be moved.
- Some visibilities in `rustc_query_system` required changing.
- `collect_active_jobs_from_all_queries` is no longer required in `trait
  QueryContext`.
2026-02-10 16:59:33 +11:00
Nicholas Nethercote 0932068b6c Move the QueryOverflow and QueryOverflowNote errors.
They are defined in `rustc_query_system` but used in `rustc_query_impl`.
This is very much *not* how things are supposed to be done; I suspect
someone got lazy and took a shortcut at some point.

This commit moves the errors into `rustc_query_impl`. This requires more
lines of code to give `rustc_query_impl` an errors module, but it's
worthwhile to do things in the normal way instead of a weird exceptional
way.
2026-02-05 09:29:46 +11:00
Jana Dönszelmann 6087d89004 fixup limit handling code 2025-09-08 15:07:12 -07:00
Nicholas Nethercote 301655eafe Revert introduction of [workspace.dependencies].
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-09-02 19:12:54 +10:00
Nicholas Nethercote 8fc0813e29 Add measureme to [workspace.dependencies]. 2025-08-28 20:12:14 +10:00
Nicholas Nethercote c50d2cc807 Add tracing to [workspace.dependencies]. 2025-08-27 14:21:19 +10:00
Nicholas Nethercote 8121958fda Use -Wunused_crate_dependencies for compiler crates.
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-20 08:59:43 +11:00
LuuuXXX 7279acf202 use measureme-12.0.1 2025-03-04 17:13:46 +08:00
LuuuXXX 6324b39873 promote ohos targets to tier to with host tools 2025-03-04 17:13:46 +08:00
Jana Dönszelmann dbd3b7928e Introduce new parsing infrastructure and types for parsed attributes
fixup docs in parser
2025-02-24 14:26:06 +01:00
Michael Goulet 76d341fa09 Upgrade the compiler to edition 2024 2025-02-22 00:01:48 +00:00
Ben Kimock 4cf21866e8 Move hashes from rustc_data_structure to rustc_hashes so they can be shared with rust-analyzer 2025-02-16 16:18:30 -05:00
David Venhoek 62bbaa8091 Removed dependency on the field-offset crate. 2025-02-05 17:56:06 +01:00
Noratrieb 505b8e1332 Delete the cfg(not(parallel)) serial compiler
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-12 13:38:58 +00:00
Nicholas Nethercote 29629d0075 Remove some unused crate dependencies.
I found these by setting the `unused_crate_dependencies` lint
temporarily to `Warn`.
2024-06-10 19:55:49 +10:00
Michael Woerister ac58f9ae03 Update measureme crate to version 11 2024-01-13 16:32:03 +01:00
Nicholas Nethercote 8ff624a9f2 Clean up rustc_*/Cargo.toml.
- Sort dependencies and features sections.
- Add `tidy` markers to the sorted sections so they stay sorted.
- Remove empty `[lib`] sections.
- Remove "See more keys..." comments.

Excluded files:
- rustc_codegen_{cranelift,gcc}, because they're external.
- rustc_lexer, because it has external use.
- stable_mir, because it has external use.
2023-10-30 08:46:02 +11:00
Nicholas Nethercote 28e60de487 Remove memoffset dependency from rustc_query_impl.
The comment explains it's for `unstable_offset_of`, but `offset_of` is
now stable.
2023-10-30 08:25:51 +11:00
Nicholas Nethercote 442a66d385 Remove unneeded dependency. 2023-10-06 14:57:09 +11:00
klensy 6950689030 remove some unused crate deps 2023-09-01 19:13:09 +03:00
est31 b048396f44 Update field-offset and enable unstable_offset_of
This enables usage of the offset_of!() macro in the compiler,
through the wrappers in memoffset and then in field-offset.
2023-06-05 15:57:13 +02:00
klensy 9b6a6b13c5 deps: bump crates
update iana-time-zone-haiku to drop bumch of cxx* deps
cargo update -p iana-time-zone-haiku
    Updating crates.io index
    Updating cc v1.0.77 -> v1.0.79
    Removing codespan-reporting v0.11.1
    Removing cxx v1.0.94
    Removing cxx-build v1.0.94
    Removing cxxbridge-flags v1.0.94
    Removing cxxbridge-macro v1.0.94
    Updating iana-time-zone-haiku v0.1.1 -> v0.1.2
    Removing link-cplusplus v1.0.8
    Removing scratch v1.0.5

fixes known issue https://github.com/crossbeam-rs/crossbeam/pull/972
cargo update -p crossbeam-channel
    Updating crates.io index
    Updating crossbeam-channel v0.5.6 -> v0.5.8

dedupes memoffset versions
cargo update -p crossbeam-epoch
    Updating crates.io index
    Updating crossbeam-epoch v0.9.13 -> v0.9.14
    Removing memoffset v0.7.1

dedupes bstr versions
cargo update -p ignore -p opener
    Updating crates.io index
    Removing bstr v0.2.17
    Updating globset v0.4.9 -> v0.4.10
    Updating ignore v0.4.18 -> v0.4.20
    Updating opener v0.5.0 -> v0.5.2
2023-05-26 13:03:47 +03:00
John Kåre Alsaker 2fe28ae0a4 Use dynamic dispatch for queries 2023-04-30 09:48:47 +02:00
John Kåre Alsaker 27c44d2e28 Update indexmap and rayon crates 2023-03-25 02:12:13 +01:00
Nicholas Nethercote 06228d6e93 Upgrade thin-vec from 0.2.9 to 0.2.12.
Because 0.2.10 added supports for `ThinVec::splice`, and 0.2.12 is the
latest release.
2023-02-21 11:51:55 +11:00
klensy 4f5f9f0a13 remove unused imports 2023-02-06 17:40:18 +03:00
CarsonV f98adb32f5 Enable query_impl doctests 2023-01-03 20:38:28 -06:00
Michael Howell 03968a802c rustdoc: use ThinVec for cleaned generics 2022-11-02 16:17:22 -07:00
Nicholas Nethercote b38106b6d8 Replace rustc_data_structures::thin_vec::ThinVec with thin_vec::ThinVec.
`rustc_data_structures::thin_vec::ThinVec` looks like this:
```
pub struct ThinVec<T>(Option<Box<Vec<T>>>);
```
It's just a zero word if the vector is empty, but requires two
allocations if it is non-empty. So it's only usable in cases where the
vector is empty most of the time.

This commit removes it in favour of `thin_vec::ThinVec`, which is also
word-sized, but stores the length and capacity in the same allocation as
the elements. It's good in a wider variety of situation, e.g. in enum
variants where the vector is usually/always non-empty.

The commit also:
- Sorts some `Cargo.toml` dependency lists, to make additions easier.
- Sorts some `use` item lists, to make additions easier.
- Changes `clean_trait_ref_with_bindings` to take a
  `ThinVec<TypeBinding>` rather than a `&[TypeBinding]`, because this
  avoid some unnecessary allocations.
2022-08-29 15:42:13 +10:00
Michael Goulet 5309375d2c Do not report cycle error when inferring return type for suggestion 2022-08-16 03:00:32 +00:00
klensy 4ea4e2e76d remove currently unused deps 2022-06-13 22:20:51 +03:00
bors 0f06824013 Auto merge of #97287 - compiler-errors:type-interner, r=jackh726,oli-obk
Move things to `rustc_type_ir`

Finishes some work proposed in https://github.com/rust-lang/compiler-team/issues/341.

r? `@ghost`
2022-05-29 08:20:13 +00:00
Wilco Kusee a7015fe816 Move things to rustc_type_ir 2022-05-28 11:38:22 -07:00
Josh Stone ab57e36268 Update to rebased rustc-rayon 0.4 2022-05-27 20:20:41 -07:00
Oli Scherer 0d5a738b8b Enable tracing for all queryies 2022-05-04 16:15:26 +00:00
klensy 008fc79dcd Propagate parallel_compiler feature through rustc crates. Turned off feature gives change of builded crates: 238 -> 224. 2022-03-28 08:41:12 +03:00
Josh Stone f3b8812f24 Update rayon and rustc-rayon 2022-01-10 11:34:07 -08:00
Camille GILLOT 602d3cbce3 Invoke callbacks from rustc_middle. 2021-10-20 18:29:33 +02:00
Ryan Levick 757f76ef73 Update to measureme v10 2021-10-07 15:08:44 +02:00
Ryan Levick 947a33bf20 Add support for artifact size profiling 2021-10-07 14:22:29 +02:00
Mark Rousskov c746be2219 Migrate to 2021 2021-09-20 22:21:42 -04:00
Jade 3cf820e17d rfc3052: Remove authors field from Cargo manifests
Since RFC 3052 soft deprecated the authors field anyway, hiding it from
crates.io, docs.rs, and making Cargo not add it by default, and it is
not generally up to date/useful information, we should remove it from
crates in this repo.
2021-07-29 14:56:05 -07:00
Camille GILLOT 81241cbf3a Move OnDiskCache to rustc_query_impl. 2021-07-18 11:14:07 +02:00
Josh Triplett e721e15cd2 rustc_query_impl: Remove unused dependencies 2021-06-25 01:13:00 -07:00
Josh Stone f7e75a2124 Update to rustc-rayon 0.3.1
This pulls in rust-lang/rustc-rayon#8 to fix #81425. (h/t @ammaraskar)

That revealed weak constraints on `rustc_arena::DropArena`, because its
`DropType` was holding type-erased raw pointers to generic `T`. We can
implement `Send` for `DropType` (under `cfg(parallel_compiler)`) by
requiring all `T: Send` before they're type-erased.
2021-03-10 17:53:35 -08:00