about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src
AgeCommit message (Collapse)AuthorLines
2023-12-15NFC don't convert types to identical typesMatthias Krüger-1/+1
2023-12-13Auto merge of #117050 - c410-f3r:here-we-go-again, r=petrochenkovbors-0/+144
[`RFC 3086`] Attempt to try to resolve blocking concerns Implements what is described at https://github.com/rust-lang/rust/issues/83527#issuecomment-1744822345 to hopefully make some progress. It is unknown if such approach is or isn't desired due to the lack of further feedback, as such, it is probably best to nominate this PR to the official entities. `@rustbot` labels +I-compiler-nominated
2023-12-10remove redundant importssurechen-5/+1
detects redundant imports that can be eliminated. for #117772 : In order to facilitate review and modification, split the checking code and removing redundant imports code into two PR.
2023-12-081. fix jobserver GLOBAL_CLIENT_CHECKED uninitialized before useoksbsb-1/+1
2. jobserver::initialize_checked should call before build_session, still should use EarlyErrorHandler, so revert stderr change in #118635
2023-12-01Attempt to try to resolve blocking concernsCaio-0/+144
2023-11-29jobserver: check file descriptorsbelovdv-29/+67
2023-11-28Avoid an unnecessary `by_ref`.Nicholas Nethercote-1/+1
2023-11-23Enforce NonZeroUsize on thread countMark Rousskov-4/+7
This allows avoiding some if != 0 checks when allocating worker-local datasets.
2023-11-22Replace `no_ord_impl` with `orderable`.Nicholas Nethercote-0/+1
Similar to the previous commit, this replaces `newtype_index`'s opt-out `no_ord_impl` attribute with the opt-in `orderable` attribute.
2023-11-21Fix `clippy::needless_borrow` in the compilerNilstrieb-2/+2
`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-11-15Bump cfg(bootstrap)sMark Rousskov-2/+2
2023-11-14Fix some typoscui fliter-5/+5
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-11-09Auto merge of #117557 - Zoxc:panic-prio, r=petrochenkovbors-13/+29
Make `FatalErrorMarker` lower priority than other panics This makes `FatalErrorMarker` lower priority than other panics in a parallel sections. If any other panics occur, they will be unwound instead of `FatalErrorMarker`. This ensures `rustc` will exit with the correct error code on ICEs. This fixes https://github.com/rust-lang/rust/issues/116659.
2023-11-06Auto merge of #117435 - SparrowLii:nightly_parallel, r=oli-obk,davidtwcobors-2/+21
enable parallel rustc front end in nightly builds Refers to the [MCP](https://github.com/rust-lang/compiler-team/issues/681), this pr does: 1. Enable the parallel front end in nightly builds, and keep the default number of threads as 1. Then users can use the parallel rustc front end via -Z threads=n option. 2. Set it up to serial front end for beta/stable builds via bootstrap. 3. Switch over the alt builders from parallel rustc to serial, so we have artifacts without parallel to test against the artifacts with parallel. r? `@oli-obk` cc `@cjgillot` `@nnethercote` `@bjorn3` `@Kobzol`
2023-11-06use portable AtomicU64 for powerPC and MIPSSparrowLii-2/+21
2023-11-03Make `FatalErrorMarker` lower priority than other panicsJohn Kåre Alsaker-13/+29
2023-11-03Use `filter_map` in `try_par_for_each_in`Josh Stone-7/+6
This simplifies the expression, especially for the rayon part, and also lets us drop the `E: Copy` constraint.
2023-10-23Auto merge of #116849 - oli-obk:error_shenanigans, r=cjgillotbors-1/+30
Avoid a `track_errors` by bubbling up most errors from `check_well_formed` I believe `track_errors` is mostly papering over issues that a sufficiently convoluted query graph can hit. I made this change, while the actual change I want to do is to stop bailing out early on errors, and instead use this new `ErrorGuaranteed` to invoke `check_well_formed` for individual items before doing all the `typeck` logic on them. This works towards resolving https://github.com/rust-lang/rust/issues/97477 and various other ICEs, as well as allowing us to use parallel rustc more (which is currently rather limited/bottlenecked due to the very sequential nature in which we do `rustc_hir_analysis::check_crate`) cc `@SparrowLii` `@Zoxc` for the new `try_par_for_each_in` function
2023-10-20Avoid a `track_errors` by bubbling up most errors from `check_well_formed`Oli Scherer-1/+30
2023-10-19Initiate the inner usage of `cfg_match`Caio-47/+50
2023-10-18Auto merge of #116830 - nnethercote:rustc_type_ir, r=compiler-errorsbors-121/+0
Remove `IdFunctor` trait. It's defined in `rustc_data_structures` but is only used in `rustc_type_ir`. The code is shorter and easier to read if we remove this layer of abstraction and just do the things directly where they are needed. r? `@BoxyUwU`
2023-10-17Remove `IdFunctor` trait.Nicholas Nethercote-119/+0
It's defined in `rustc_data_structures` but is only used in `rustc_type_ir`. The code is shorter and easier to read if we remove this layer of abstraction and just do the things directly where they are needed.
2023-10-17Remove unused features from `rustc_data_structures`.Nicholas Nethercote-2/+0
2023-10-16docs: add Rust logo to more compiler cratesMichael Howell-0/+2
c6e6ecb1afea9695a42d0f148ce153536b279eb5 added it to some of the compiler's crates, but avoided adding it to all of them to reduce bit-rot. This commit adds to more.
2023-10-10Remove unused dominator iteratorTomasz Miąsko-26/+1
2023-10-05Optimize dominators for small path graphsTomasz Miąsko-10/+65
Generalizes the small dominators approach from #107449.
2023-10-05Remove redundant Dominators::start_node fieldTomasz Miąsko-3/+2
2023-10-05Test immediate dominators using public APITomasz Miąsko-24/+21
2023-09-25Rename `cold_path` to `outline`John Kåre Alsaker-9/+6
2023-09-24Add OwnedTargetMachine to manage llvm:TargetMachine. Uses pointersFlorian Schmiderer-0/+6
instead of &'static mut and provides safe interface to create/dispose it.
2023-09-21Auto merge of #115230 - Vtewari2311:mod-hurd-latest, r=b-naberbors-4/+20
added support for GNU/Hurd adding support for i686-unknown-hurd-gnu
2023-09-21added support for GNU/HurdSamuel Thibault-4/+20
2023-09-19use pretty_print_const_value from MIR constant 'extra' printingRalf Jung-0/+19
2023-09-18coverage: Simplify sorting of coverage spans extracted from MIRZalathar-3/+3
Switching to `Ordering::then_with` makes control-flow less complicated, and there is no need to use `partial_cmp` here.
2023-09-11Rollup merge of #115548 - Zoxc:parallel-extract, r=wesleywiserMatthias Krüger-171/+193
Extract parallel operations in `rustc_data_structures::sync` into a new `parallel` submodule This extracts parallel operations in `rustc_data_structures::sync` into a new `parallel` submodule. This cuts down on the size of the large `cfg_if!` in `sync` and makes it easier to compare between serial and parallel variants.
2023-09-11Auto merge of #115388 - Zoxc:sharded-lock, r=SparrowLiibors-194/+242
Add optimized lock methods for `Sharded` and refactor `Lock` This adds methods to `Sharded` which pick a shard and also locks it. These branch on parallelism just once instead of twice, improving performance. Benchmark for `cfg(parallel_compiler)` and 1 thread: <table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check</td><td align="right">1.6461s</td><td align="right">1.6345s</td><td align="right"> -0.70%</td></tr><tr><td>🟣 <b>hyper</b>:check</td><td align="right">0.2414s</td><td align="right">0.2394s</td><td align="right"> -0.83%</td></tr><tr><td>🟣 <b>regex</b>:check</td><td align="right">0.9205s</td><td align="right">0.9143s</td><td align="right"> -0.67%</td></tr><tr><td>🟣 <b>syn</b>:check</td><td align="right">1.4981s</td><td align="right">1.4869s</td><td align="right"> -0.75%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check</td><td align="right">5.7629s</td><td align="right">5.7256s</td><td align="right"> -0.65%</td></tr><tr><td>Total</td><td align="right">10.0690s</td><td align="right">10.0008s</td><td align="right"> -0.68%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9928s</td><td align="right"> -0.72%</td></tr></table> cc `@SparrowLii`
2023-09-09Use `FreezeLock` for `CStore`John Kåre Alsaker-16/+45
2023-09-08Add Freeze::cloneJohn Kåre Alsaker-0/+10
2023-09-08Remove the `LockMode` enum and `dispatch`John Kåre Alsaker-107/+79
2023-09-08Refactor `Lock` implementationJohn Kåre Alsaker-246/+216
2023-09-08Add optimized lock methods for `Sharded`John Kåre Alsaker-17/+123
2023-09-07Use `Freeze` for `SourceFile.lines`John Kåre Alsaker-0/+12
2023-09-07Use `Freeze` for `SourceFile.external_src`John Kåre Alsaker-3/+44
2023-09-06Use a reference to the lock in the guardsJohn Kåre Alsaker-15/+14
2023-09-06Extract parallel operations in `rustc_data_structures::sync` into a new ↵John Kåre Alsaker-171/+193
`parallel` submodule
2023-09-02Rename `Freeze` to `FreezeLock`John Kåre Alsaker-8/+8
2023-09-02Add some commentsJohn Kåre Alsaker-1/+4
2023-09-02Use `RwLock` for `Freeze`John Kåre Alsaker-8/+10
2023-09-02Add `Freeze` type and use it to store `Definitions`John Kåre Alsaker-0/+107
2023-09-01Use `OnceLock` for `SingleCache`John Kåre Alsaker-2/+2