Commit Graph

1074 Commits

Author SHA1 Message Date
Daria Sukhonina 50c564e679 Make par_slice consistent with single-threaded execution 2026-03-21 08:23:42 +03:00
Jonathan Brouwer 8a30071e7c Rollup merge of #153776 - zetanumbers:curry-howard-dyn-thread-safe, r=JonathanBrouwer
Remove redundant `is_dyn_thread_safe` checks

Refactor uses of `FromDyn` to reduce number of redundant `is_dyn_thread_safe` checks by replacing `FromDyn::from` with `check_dyn_thread_safe` in tandem with existing `FromDyn::derive` so that the users would avoid redundancy in the future.

PR is split up into multiple commits for an easier review.
2026-03-20 13:24:24 +01:00
Zalathar fb850aebcd Remove unused types UnusedGenericParams and FiniteBitSet
These types have been unused since polymorphization was removed in
<https://github.com/rust-lang/rust/pull/133883>.
2026-03-18 10:36:19 +11:00
Daria Sukhonina 3973d9f558 Remove FromDyn::from and add check_dyn_thread_safe 2026-03-17 14:46:12 +03:00
Daria Sukhonina 15f42e2613 Move FromDyn closer to is_dyn_thread_safe 2026-03-17 14:33:31 +03:00
Stuart Cook 76b769c8ad Rollup merge of #152621 - petrochenkov:graph2, r=Zalathar
LinkedGraph: support adding nodes and edges in arbitrary order

If an edge uses some not-yet-known node, we just leave the node's data empty, that data can be added later.

Use this support to avoid skipping edges in RetainedDepGraph.

This is continuation of https://github.com/rust-lang/rust/pull/152590, that PR just fixes the ICE, this PR also preserves all the edges in debug dumps.
This is also a minimized version of https://github.com/rust-lang/rust/pull/151821 with a smaller amount of data structure hacks.
2026-03-14 17:30:22 +11:00
John Kåre Alsaker bee28ef7b2 Remove MTLock 2026-03-12 14:37:51 +01:00
Jonathan Brouwer 707bf0961a Rollup merge of #152569 - oli-obk:rustc_layout_scalar_valid_range_end_end, r=davidtwco
Stop using rustc_layout_scalar_valid_range_* in rustc

*[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/pull/152569)*

Another step towards rust-lang/rust#135996

Required some manual impls, but we already do many manual impls for the newtype_index types, so it's not really a new maintenance burden.
2026-03-11 22:05:41 +01:00
Zalathar 985b41d387 Remove the rustc_data_structures::assert_matches! re-exports 2026-03-08 22:02:23 +11:00
Josh Stone 32bae1353e Update cfg(bootstrap) 2026-03-07 10:42:02 -08:00
Oli Scherer ff7e604154 Stop using rustc_layout_scalar_valid_range_* in rustc 2026-03-07 15:36:56 +00:00
Zalathar 743d442845 Rename QueryCache::iter to for_each
Methods that perform internal iteration are typically named `for_each`.
2026-03-05 23:39:59 +11:00
Jonathan Brouwer ef4cff2ea3 Rollup merge of #153015 - joboet:atomic_alias_generic, r=jhpratt
core: make atomic primitives type aliases of `Atomic<T>`

Tracking issue: https://github.com/rust-lang/rust/issues/130539

This makes `AtomicI32` and friends type aliases of `Atomic<T>` by encoding their alignment requirements via the use of an internal `Storage` associated type. This is also used to encode that `AtomicBool` store a `u8` internally.

Modulo the `Send`/`Sync` implementations, this PR does not move any trait implementations, methods or associated functions – I'll leave that for another PR.
2026-03-02 20:10:34 +01:00
joboet 4b86b1a11a compiler: manually implement DynSend for atomic primitives
The manual `DynSend` implementation for `AtomicPtr` blocks the
auto-implementation for other atomic primitives since they forward to the same
`Atomic<T>` type now. This breakage cannot occur in user code as it depends on
`DynSend` being a custom auto-trait.
2026-03-02 00:23:23 +01:00
Josh Stone 696a7a1f04 Simplify AppendOnlyVec iterators 2026-02-25 08:09:43 -08:00
Stuart Cook 8c96521c99 Rollup merge of #152987 - Zoxc:hashstable-derives, r=JonathanBrouwer
Use `HashStable` derive in more places

This applies `HashStable` derive in a couple more places. Also `stable_hasher` is declared for `HashStable_NoContext`.
2026-02-23 13:32:01 +11:00
John Kåre Alsaker 912c7d31d2 Use HashStable derive in more places 2026-02-22 21:01:27 +01:00
Folkert de Vries 14d29f9ae2 Stabilize cfg_select 2026-02-22 19:59:25 +01:00
Vadim Petrochenkov 96697d41ed LinkedGraph: support adding nodes and edges in arbitrary order
If an edge uses some not-yet-known node, we just leave the node's data empty, that data can be added later.

Use this support to avoid skipping edges in DepGraphQuery
2026-02-22 10:53:56 +03:00
Vadim Petrochenkov 71d656edde LinkedGraph: Use IndexVec instead of Vec in LinkedGraph nodes 2026-02-22 10:46:40 +03:00
Daria Sukhonina 33a8dc10cf Fix wrong par_slice implementation 2026-02-16 17:49:42 +03:00
bors 4c37f6d78c Auto merge of #152375 - Zoxc:rayon-scope-loops, r=jieyouxu,lqd
Use `scope` for `par_slice` instead of `join`

This uses `scope` instead of nested `join`s in `par_slice` so that each group of items are independent and do not end up blocking on another.
2026-02-15 09:55:40 +00:00
bors 75b9d89c68 Auto merge of #151380 - ShoyuVanilla:shallow-resolve-to-root-var, r=lcnr
Shallow resolve ty and const vars to their root vars

Continuation of https://github.com/rust-lang/rust/pull/147193
2026-02-15 03:04:28 +00:00
Jonathan Brouwer 65d982abd8 Rollup merge of #152469 - mu001999-contrib:cleanup/unused-features, r=nadrieril,jdonszelmann
Remove unused features

Detected by https://github.com/rust-lang/rust/pull/152164.

~~Only allow `unused_features` if there are complex platform-specific features enabled.~~
2026-02-13 13:34:58 +01:00
Stuart Cook 09720ec3d0 Rollup merge of #152329 - Zoxc:simple-parallel-macro, r=nnethercote
Simplify parallel! macro

This replaces the `parallel!` macro with a `par_fns` function.
2026-02-13 15:19:12 +11:00
mu001999 a07f837491 Remove unused features in compiler 2026-02-13 09:25:39 +08:00
John Kåre Alsaker 8c5ce26e43 Replace parallel! macro with par_fns function and rename join to par_join 2026-02-12 12:20:18 +01:00
Lukas Bergdoll 2f3b952349 Stabilize assert_matches 2026-02-11 14:13:44 +01:00
Shoyu Vanilla 1f53258660 Bump ena 2026-02-11 17:05:50 +09:00
John Kåre Alsaker 91a6126208 Use scope for par_slice instead of join 2026-02-09 07:59:18 +01:00
Zalathar 118372ed13 Replace some feature(core_intrinsics) with stable hints 2026-02-08 18:21:47 +11:00
Nicholas Nethercote c9f827754a Make HashingControls impl Copy.
It has a single `bool` field.
2026-02-06 09:18:18 +11:00
WANG Rui 78b55fc337 Fix incorrect RSS on systems with non-4K page size
`get_resident_set_size` computed RSS by multiplying the number of pages
from `/proc/self/statm` with a hard-coded 4096-byte page size. This
produces incorrect results on systems where the runtime page size is
not 4 KiB.

Use `sysconf(_SC_PAGESIZE)` to determine the actual page size at runtime
so the RSS reported in `-Z time-passes` output is accurate across
platforms.
2026-02-04 23:32:36 +08:00
bors 0c40f5be0c Auto merge of #151929 - camsteffen:lengg, r=BoxyUwU
Use with_capacity in query_key_hash_verify and PlaceholderExpander

Addresses the first two items from https://github.com/rust-lang/rust/issues/137005#issuecomment-2687803558.
2026-02-03 22:20:57 +00:00
bors 57d2fb1366 Auto merge of #138405 - Zoxc:vec-cache-tweaks, r=Mark-Simulacrum
Tweak `VecCache` to improve performance

This has some tweaks to `VecCache` to improve performance.

- It saves a `compare_exchange` in `complete` using the new `put_unique` function.
- It removes bound checks on entries. These are instead checked in the `slot_index_exhaustive` test.
- `initialize_bucket` is outlined and tuned for that.

cc @Mark-Simulacrum
2026-02-01 18:57:12 +00:00
Cameron Steffen f0b76d5a15 Use with_capacity in query_key_hash_verify 2026-01-31 18:57:32 -06:00
Zalathar 04e6afe20a Re-export hashbrown::hash_table from rustc_data_structures 2026-01-31 14:48:50 +11:00
Amanda Stjerna 4bdccabda5 Borrowck: Simplify SCC annotation computation, placeholder rewriting
This simplifies the `PlaceholderReachability` `enum` by
replacing the case when no placeholders were reached with
a standard `Option::None`.

It also rewrites the API for `scc::Annotations` to be update-mut
rather than a more Functional programming style. This showed some slight
performance impact in early tests of the PR and definitely makes
the implementation simpler.
2026-01-27 14:22:53 +01:00
John Kåre Alsaker cd18a8d287 Tweak VecCache to improve performance 2026-01-26 22:36:00 +01:00
Andre Bogus 8c697128eb refactor rustc-hash integration 2026-01-23 23:16:15 +01:00
Jonathan Brouwer f03c1a2bd3 Rollup merge of #151423 - Voultapher:move-assert-matches, r=Amanieu
Move assert_matches to planned stable path

Another prep PR for https://github.com/rust-lang/rust/pull/137487
2026-01-22 13:35:41 +01:00
Mark Rousskov 3dc7a1f33b Bump stage0 2026-01-21 20:03:56 -05:00
Lukas Bergdoll 58be5d6620 Move assert_matches to planned stable path 2026-01-21 23:17:24 +01:00
bors 7981818138 Auto merge of #151076 - cuviper:compiler-hashbrown-0.16.1, r=Amanieu
compiler: upgrade to hashbrown 0.16.1

See also rust-lang/rust#135634, rust-lang/rust#149159, and rust-lang/hashbrown#662.

This includes an in-tree upgrade of `indexmap` as well, which uses the
new `HashTable` buckets API internally, hopefully impacting performance
for the better.

And finally, we can remove `#[rustc_unsafe_specialization_marker]` on `Copy`!

cc @joboet
r? @Amanieu
2026-01-20 05:44:13 +00:00
Zalathar 7ec34defe9 Temporarily re-export assert_matches! to reduce stabilization churn 2026-01-19 18:26:53 +11:00
Esteban Küber 2766ccfd4e Make UnordSet and UnordMap const Default and use it in Resolver 2026-01-16 02:38:18 +00:00
Esteban Küber bfd1a9a86f Use default_field_values more in Resolver
Provide `const` functions to get around lack of `const Default` for `FxHash*` types.

Use default field values in `Resolver` more.
2026-01-16 02:38:17 +00:00
Josh Stone 348bfe3e35 compiler: upgrade to hashbrown 0.16.1
See also #135634, #149159, and rust-lang/hashbrown#662.

This includes an in-tree upgrade of `indexmap` as well, which uses the
new `HashTable` buckets API internally, hopefully impacting performance
for the better!
2026-01-13 11:18:09 -08:00
bors 08de25c4ea Auto merge of #149273 - bjorn3:crate_locator_improvements, r=petrochenkov
Don't leak sysroot crates through dependencies

Previously if a dependency of the current crate depended on a sysroot crate, then `extern crate` would in the current crate would pick the first loaded version of said sysroot crate even in case of an ambiguity. This is surprising and brittle. For `-Ldependency=` we already blocked this since rust-lang/rust#110229, but the fix didn't account for sysroot crates.

Should fix https://github.com/rust-lang/rust/issues/147966
2025-12-14 09:16:11 +00:00
Andrew Zhogin 1b790cdcac Weak for Arc pointer is marked as DynSend/DynSync 2025-12-11 16:46:32 +07:00