about summary refs log tree commit diff
path: root/compiler/rustc_index
AgeCommit message (Collapse)AuthorLines
2025-09-26Apply cfg(bootstrap) replacementMark Rousskov-6/+0
2025-09-21Rollup merge of #144091 - thaliaarchi:stabilize-new-zeroed, r=Mark-SimulacrumStuart Cook-3/+3
Stabilize `new_zeroed_alloc` The corresponding `new_uninit` and `new_uninit_slice` functions were stabilized in rust-lang/rust#129401, but the zeroed counterparts were left for later out of a [desire](https://github.com/rust-lang/rust/issues/63291#issuecomment-2161039756) to stabilize only the minimal set. These functions are straightforward mirrors of the uninit functions and well-established. Since no blockers or design questions have surfaced in the past year, I think it's time to stabilize them. Tracking issue: rust-lang/rust#129396
2025-09-10Rollup merge of #144765 - Qelxiros:range-inclusive-last, r=jhprattMatthias Krüger-0/+15
inclusive `Range`s: change `end` to `last` Tracking issue: rust-lang/rust#125687 ACP: rust-lang/libs-team#511
2025-09-08change end to lastJeremy Smart-0/+15
2025-09-07Do not use prepend to avoid quadratic behaviour.Camille Gillot-35/+9
2025-09-07Use regular MaybeLiveLocals.Camille Gillot-2/+5
2025-09-07Reimplement DestinationPropagation according to live ranges.Camille GILLOT-0/+26
2025-09-07Introduce fast insertion at extremities to IntervalSet.Camille GILLOT-0/+51
2025-08-24Update documentation.Camille Gillot-9/+3
2025-08-23Remove chunk size from each chunk.Camille GILLOT-135/+162
2025-07-31Tidy up `Cargo.toml` files.Nicholas Nethercote-1/+1
- Add some missing `tidy-alphabetical-*` markers. - Remove some unnecessary blank lines.
2025-07-19Stabilize `new_zeroed_alloc`Thalia Archibald-3/+3
2025-07-05use `div_ceil` instead of manual logicFolkert de Vries-2/+2
2025-06-04index: add method for checking range on DenseBitSetNia Espera-0/+45
2025-04-15Add `copy_within` to `IndexSlice`Jason Newcomb-1/+12
2025-03-15Use {Decodable,Encodable}_NoContext in type_irMichael Goulet-4/+4
2025-03-12Rollup merge of #138331 - nnethercote:use-RUSTC_LINT_FLAGS-more, ↵Matthias Krüger-1/+0
r=onur-ozkan,jieyouxu Use `RUSTC_LINT_FLAGS` more An alternative to the failed #138084. Fixes #138106. r? ````@jieyouxu````
2025-03-12Rollup merge of #138372 - Eclips4:issue-138196, r=scottmcmMatthias Krüger-15/+20
Refactor `pick2_mut` & `pick3_mut` to use `get_disjoint_mut` Closes #138196
2025-03-12Auto merge of #137795 - Jarcho:idx_opt, r=davidtwcobors-0/+10
Allow bounds checks when enumerating `IndexSlice` to be elided Without this hint, each loop iteration has to separately bounds check the index. See https://godbolt.org/z/zrfPY4Ten for an example. This is technically a behaviour change, but only in cases where the compiler is going to crash anyways.
2025-03-12Make panic's more specificKirill Podoprigora-10/+13
2025-03-11Refactor pick2_mut & pick3_mut to use get_disjoint_mutKirill Podoprigora-8/+10
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-09Rollup merge of #138084 - nnethercote:workspace-lints, r=jieyouxuMatthias Krüger-1/+3
Use workspace lints for crates in `compiler/` This is nicer and hopefully less error prone than specifying lints via bootstrap. r? ``@jieyouxu``
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-07compiler: Use size_of from the prelude instead of importedThalia Archibald-4/+4
Use `std::mem::{size_of, size_of_val, align_of, align_of_val}` from the prelude instead of importing or qualifying them. These functions were added to all preludes in Rust 1.80.
2025-02-28Allow the optimizer to elide bounds checks when enumerating ↵Jason Newcomb-0/+10
`IndexSlice`/`IndecVec`.
2025-02-24Rollup merge of #136610 - Jarcho:range_idx, r=NoratriebJacob Pratt-14/+113
Allow `IndexSlice` to be indexed by ranges. This comes with some annoyances as the index type can no longer inferred from indexing expressions. The biggest offender for this is `IndexVec::from_fn_n(|idx| ..., n)` where the index type won't be inferred from the call site or any index expressions inside the closure. My main use case for this is mapping a `Place` to `Range<Idx>` for value tracking where the range represents all the values the place contains.
2025-02-22Greatly simplify lifetime captures in edition 2024Michael Goulet-9/+7
2025-02-22Fix binding mode problemsMichael Goulet-16/+4
2025-02-22Upgrade the compiler to edition 2024Michael Goulet-1/+1
2025-02-21Allow SliceIndex to be indexed by ranges.Jason Newcomb-14/+113
2025-02-08Rustfmtbjorn3-40/+48
2025-01-19Run `clippy --fix` for `unnecessary_map_or` lintYotam Ofek-1/+1
2025-01-14Add `DenseBitSet::union_not`Zalathar-0/+56
This is similar to the existing `union`, except that bits in the RHS are negated before being incorporated into the LHS. Currently only `DenseBitSet` is supported. Supporting other bitset types is possible, but non-trivial, and currently isn't needed.
2025-01-11document the use-cases of `DenseBitSet` a bit moreRémy Rakic-1/+7
2025-01-11rename `BitSet` to `DenseBitSet`Rémy Rakic-68/+72
This should make it clearer that this bitset is dense, with the advantages and disadvantages that it entails.
2024-12-29improve `bit_set` assertionRémy Rakic-1/+6
it missed the index and bounds info
2024-12-21Rollup merge of #134526 - onur-ozkan:nightly-feat-rustc, r=jieyouxuMatthias Krüger-1/+1
update `rustc_index_macros` feature handling It seems that cargo can't [conditionally propagate features](https://github.com/rust-lang/rust/blob/214587c89d527dd0ccbe1f2150c737d3bdee67b0/compiler/rustc_index/Cargo.toml#L20) if they were enabled by default on the target crate, but disabled with `default-features = false` in the current/parent crate. Fixes #118129
2024-12-19update `rustc_index_macros` feature handlingonur-ozkan-1/+1
It seems that cargo can't conditionally propagate features when `default-features` is set to `false`. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-12-17add `MixedBitSet::clear`Rémy Rakic-0/+8
2024-12-09Use `BitSet` in `SparseBitMatrix`.Nicholas Nethercote-13/+13
A `ChunkedBitSet` has to be at least 2048 bits for it to outperform a `BitSet`, because that's the chunk size. The largest `SparseBitMatrix` encountered when compiling the compiler and the entire rustc-perf benchmark suite is less than 600 bits. This change is a tiny perf win, but the motivation is more about avoiding uses of `ChunkedBitSet` outside of `MixedBitSet`. The test change is necessary to avoid hitting the `<BitSet<T> as BitRelations<ChunkedBitSet<T>>>::subtract` method that has `unimplemented!` in its body and isn't otherwise used.
2024-12-05Introduce `MixedBitSet`.Nicholas Nethercote-0/+155
It just uses `BitSet` for small/medium sizes (<= 2048 bits) and `ChunkedBitSet` for larger sizes. This is good because `ChunkedBitSet` is slow and memory-hungry at smaller sizes.
2024-12-05Move some `BitSet` code blocks to a better place.Nicholas Nethercote-105/+105
These blocks are currently interleaved with `ChunkedBitSet` blocks. It makes things hard to find and has annoyed me for a while.
2024-11-29Remove `HybridBitSet`.Nicholas Nethercote-692/+3
It's no longer used.
2024-11-29Stop using `HybridBitSet` in `SparseBitMatrix`.Nicholas Nethercote-13/+18
Use `ChunkedBitSet` instead.
2024-11-29Speed up `ChunkedBitIter`Nicholas Nethercote-55/+40
The current implementation is slow because it does an operation for every bit in the set, even zero bits. So if you have a large bitset with many zero bits (which is common) it's very slow. This commit improves the iterator to skip over `Zeros` chunks in a single step, and uses the fast `BitIter` for `Mixed` chunks. It also removes the existing `fold` implementation, which was only there because the old iterator was slow.
2024-11-29Tiny `ChunkedBitSet` improvements.Nicholas Nethercote-19/+16
- Fix a typo in a comment. - Remove unnecessary `Chunk::` qualifiers. - Rename `ChunkedBitIter::bitset` as `ChunkedBitIter::bit_set`, because `bit_set` is the form used everywhere else. - Avoid some unnecessary local variables.
2024-11-29Clarify `ChunkSize` invariants.Nicholas Nethercote-4/+8
`ChunkedBitSet::is_empty` currently does an unnecessary check. This commit removes that check and adds clarifying comments and an assertion that demonstrate why it's unnecessary.