about summary refs log tree commit diff
path: root/compiler/rustc_index/src
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-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)-0/+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/+0
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-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-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-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-691/+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.
2024-11-20reduce false positives of tail-expr-drop-order from consumed valuesDing Xiang Fei-4/+136
take 2 open up coroutines tweak the wordings the lint works up until 2021 We were missing one case, for ADTs, which was causing `Result` to yield incorrect results. only include field spans with significant types deduplicate and eliminate field spans switch to emit spans to impl Drops Co-authored-by: Niko Matsakis <nikomat@amazon.com> collect drops instead of taking liveness diff apply some suggestions and add explantory notes small fix on the cache let the query recurse through coroutine new suggestion format with extracted variable name fine-tune the drop span and messages bugfix on runtime borrows tweak message wording filter out ecosystem types earlier apply suggestions clippy check lint level at session level further restrict applicability of the lint translate bid into nop for stable mir detect cycle in type structure
2024-10-10Rollup merge of #130625 - heiseish:issue-124028-fix, r=jieyouxuMatthias Krüger-0/+1
Fix a few relative paths in rustc doc ## Changes - Don't inline the doc for re-exporting some structs that have relative paths in doc. ## Context See #124028. - Most of the relative links in rustdoc are there because of circular import (so syntax like `[MyType]: rustc_foo::bar` is difficult to achieve when we cannot import `rustc_xxx` due to circular import) - Here, I disable new links for re-exports. I think it's fine for re-exported items in `hir::*`. - There is a few more relative links in other `rustc` crates, however they are not addressed in this PR, as they are not re-exported and/so the relative paths are working. Closes #124028. r​? `@fmease` Let me know if I miss anything or there's any other way to address this issue.
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-50/+42
2024-09-20no_inline for index vecGiang Dao-0/+1
2024-09-17assert that unexpectedly unsized fields are sized in the param envLukas Markeffsky-1/+1