about summary refs log tree commit diff
path: root/compiler/rustc_data_structures
AgeCommit message (Collapse)AuthorLines
2021-07-22Fix VecMap::iter_mutOli Scherer-5/+6
It used to allow you to mutate the key, even though that can invalidate the map by creating duplicate keys.
2021-07-22Auto merge of #86619 - rylev:incr-hashing-profiling, r=wesleywiserbors-11/+49
Profile incremental compilation hashing fingerprints Adds profiling instrumentation for the hashing of incremental compilation fingerprints per query. This will eventually feed into the `measureme` and `rustc-perf` infrastructure for tracking if computing hashes changes over time. TODOs: * [x] Address the FIXME where we are including node interning in the hash timing. * [ ] Update measureme/summarize to handle this new data: https://github.com/rust-lang/measureme/pull/166 * [ ] ~Update rustc-perf to handle the new data from measureme~ (will be done at a later time) r? `@ghost` cc `@michaelwoerister`
2021-07-17Some perf optimizations and loggingjackh726-0/+2
2021-07-13Fix VecMap Extend implOli Scherer-4/+6
2021-07-07Add docs to new methodsRyan Levick-2/+6
2021-07-07Profile incremental hashingRyan Levick-11/+45
2021-06-25rustc_data_structures: Drop unused dependency on crossbeam-utilsJosh Triplett-1/+0
rustc_data_structures has a dependency on crossbeam-utils but never uses it. It appears to have originally had this dependency in order to set the "nightly" feature; however, its other dependencies use a different version of crossbeam-utils, so this doesn't actually affect anything. Furthermore, in current crossbeam-utils, the "nightly" feature has become a no-op.
2021-06-22Rollup merge of #86387 - JohnTitor:now-no-unused-lifetimes, r=Mark-SimulacrumYuki Okushi-2/+0
Remove `#[allow(unused_lifetimes)]` which is now unnecessary Seems FP has been fixed, it doesn't need `#[allow(unused_lifetimes)]` anymore.
2021-06-17Prefer `partition_point` to look up assoc itemsYuki Okushi-47/+5
2021-06-17Remove `#[allow(unused_lifetimes)]` which is now unnecessaryYuki Okushi-2/+0
2021-06-11Auto merge of #85885 - bjorn3:remove_box_region, r=cjgillotbors-171/+0
Don't use a generator for BoxedResolver The generator is non-trivial and requires unsafe code anyway. Using regular unsafe code without a generator is much easier to follow. Based on #85810 as it touches rustc_interface too.
2021-06-08add VecMap docsSantiago Pastorino-0/+14
2021-06-08Use impl FnMut directly as predicate typeSantiago Pastorino-4/+1
2021-06-08Explicitly pass find arguments down the predicate so coercions can applySantiago Pastorino-2/+2
2021-06-08Inline the rest of box_regionbjorn3-82/+0
2021-06-08Inline box_region macro callsbjorn3-80/+0
2021-06-08Simplify box_region macrosbjorn3-26/+17
2021-06-08Add VecMap::get_by(FnMut -> bool)Santiago Pastorino-0/+7
2021-06-07Add VecMap to rustc_data_structuresSantiago Pastorino-0/+186
2021-06-06Rollup merge of #85436 - tamird:save-clone, r=estebankYuki Okushi-3/+2
Avoid cloning cache key r? `@estebank`
2021-06-04Unify parallel and non-parallel APIsJoshua Nelson-2/+54
It's confusing for these to be different, even if some of the methods are unused.
2021-06-04Remove unused code from `rustc_data_structures::sync`Joshua Nelson-110/+0
Found using https://github.com/est31/warnalyzer.
2021-06-04Rollup merge of #85850 - bjorn3:less_feature_gates, r=jyn514Yuki Okushi-21/+1
Remove unused feature gates The first commit removes a usage of a feature gate, but I don't expect it to be controversial as the feature gate was only used to workaround a limitation of rust in the past. (closures never being `Clone`) The second commit uses `#[allow_internal_unstable]` to avoid leaking the `trusted_step` feature gate usage from inside the index newtype macro. It didn't work for the `min_specialization` feature gate though. The third commit removes (almost) all feature gates from the compiler that weren't used anyway.
2021-06-02Auto merge of #85892 - tmiasko:i, r=oli-obkbors-0/+10
Miscellaneous inlining improvements
2021-06-02Miscellaneous inlining improvementsTomasz Miąsko-0/+10
2021-06-01Remove StableVec.Camille GILLOT-32/+0
2021-06-01Revert "Reduce the amount of untracked state in TyCtxt"Camille Gillot-0/+32
2021-05-31Remove unused feature gatesbjorn3-1/+0
2021-05-31Remove unnecessary unboxed_closures feature usagebjorn3-20/+1
It has been possible to clone closures for a while now
2021-05-30Remove StableVec.Camille GILLOT-32/+0
2021-05-25Don't panic when failing to initialize incremental directory.Eric Huss-1/+14
2021-05-18Simplify `map | unwrap_or` to `map_or`Tamir Duberstein-2/+1
2021-05-18Avoid cloning cache keyTamir Duberstein-2/+2
2021-05-04Only compute Obligation `cache_key` once in `register_obligation_at`Esteban Küber-3/+4
2021-04-29Auto merge of #84614 - RalfJung:daily, r=Mark-Simulacrumbors-1/+0
don't enable parking_lot nightly features Having the compiler itself depend on external libraries that use nightly features can lead to "fun" bootstrap situations. Within the rustc repo we use `cfg(bootstrap)` to resolve those, but that is not a reasonable option for external dependencies. So I propose we stop enabling the "nightly" feature of `parking_lot` here. In my experiments, this then indeed leads to the feature not being enabled (i.e., nothing else enables it), and everything still builds. However, this means parking_lot's `RwLock` will no longer have hardware lock elision for readers -- I hope that is okay to lose in exchange for less bootstrap brain twisting. ;) Cc `@Amanieu`
2021-04-27don't enable parking_lot nightly featuresRalf Jung-1/+0
2021-04-23Use latest crossbeamJubilee Young-1/+1
2021-04-23Use tempfileJubilee Young-1/+1
2021-04-21Use arrayvec 0.7, drop smallvec 0.6Jubilee Young-9/+6
With the arrival of min const generics, many alt-vec libraries have updated to use it in some way and arrayvec is no exception. Use the latest with minor refactoring. Also, rustc_workspace_hack is the only user of smallvec 0.6 in the entire tree, so drop it.
2021-04-08Fix outdated crate names in compiler docspierwill-1/+1
Changes `librustc_X` to `rustc_X`, only in documentation comments. Plain code comments are left unchanged. Also fix incorrect file paths.
2021-04-06Auto merge of #83821 - camelid:improve-thinvec, r=petrochenkovbors-0/+91
Add `FromIterator` and `IntoIterator` impls for `ThinVec` These should make using `ThinVec` feel much more like using `Vec`. They will allow users of `Vec` to switch to `ThinVec` while continuing to use `collect()`, `for` loops, and other parts of the iterator API. I don't know if there were use cases before for using the iterator API with `ThinVec`, but I would like to start using `ThinVec` in rustdoc, and having it conform to the iterator API would make the transition *a lot* easier. I added a `FromIterator` impl, an `IntoIterator` impl that yields owned elements, and `IntoIterator` impls that yield immutable or mutable references to elements. I also added some unit tests for `ThinVec`.
2021-04-05Add `FromIterator` and `IntoIterator` impls for `ThinVec`Camelid-0/+91
These should make using `ThinVec` feel much more like using `Vec`. They will allow users of `Vec` to switch to `ThinVec` while continuing to use `collect()`, `for` loops, and other parts of the iterator API. I don't know if there were use cases before for using the iterator API with `ThinVec`, but I would like to start using `ThinVec` in rustdoc, and having it conform to the iterator API would make the transition *a lot* easier. I added a `FromIterator` impl, an `IntoIterator` impl that yields owned elements, and `IntoIterator` impls that yield immutable or mutable references to elements. I also added some unit tests for `ThinVec`.
2021-04-03Auto merge of #83682 - bjorn3:mmap_wrapper, r=cjgillotbors-0/+51
Add an Mmap wrapper to rustc_data_structures This wrapper implements StableAddress and falls back to directly reading the file on wasm32. Taken from #83640, which I will close due to the perf regression.
2021-04-03Add safety comment to StableAddress impl for Mmapbjorn3-0/+4
2021-03-31Inline a few methodsbjorn3-0/+3
2021-03-30Add an Mmap wrapper to rustc_data_structuresbjorn3-0/+44
This wrapper implements StableAddress and falls back to directly reading the file on wasm32
2021-03-29Revert changes to sync data structuresJoshua Nelson-0/+110
There isn't currently a good reviewer for these, and I don't want to remove things that will just be added again. I plan to make a separate PR for these changes so the rest of the cleanup can land.
2021-03-27Address review commentsJoshua Nelson-2/+0
- Add back `HirIdVec`, with a comment that it will soon be used. - Add back `*_region` functions, with a comment they may soon be used. - Remove `-Z borrowck_stats` completely. It didn't do anything. - Remove `make_nop` completely. - Add back `current_loc`, which is used by an out-of-tree tool. - Fix style nits - Remove `AtomicCell` with `cfg(parallel_compiler)` for consistency.
2021-03-27Remove (lots of) dead codeJoshua Nelson-123/+0
Found with https://github.com/est31/warnalyzer. Dubious changes: - Is anyone else using rustc_apfloat? I feel weird completely deleting x87 support. - Maybe some of the dead code in rustc_data_structures, in case someone wants to use it in the future? - Don't change rustc_serialize I plan to scrap most of the json module in the near future (see https://github.com/rust-lang/compiler-team/issues/418) and fixing the tests needed more work than I expected. TODO: check if any of the comments on the deleted code should be kept.
2021-03-26Auto merge of #83465 - michaelwoerister:safe-read_raw_bytes, r=cjgillotbors-8/+28
Allow for reading raw bytes from rustc_serialize::Decoder without unsafe code The current `read_raw_bytes` method requires using `MaybeUninit` and `unsafe`. I don't think this is necessary. Let's see if a safe interface has any performance drawbacks. This is a followup to #83273 and will make it easier to rebase #82183. r? `@cjgillot`