about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src/lib.rs
AgeCommit message (Collapse)AuthorLines
2022-02-25Switch bootstrap cfgsMark Rousskov-1/+1
2022-02-23Introduce `ChunkedBitSet` and use it for some dataflow analyses.Nicholas Nethercote-0/+2
This reduces peak memory usage significantly for some programs with very large functions, such as: - `keccak`, `unicode_normalization`, and `match-stress-enum`, from the `rustc-perf` benchmark suite; - `http-0.2.6` from crates.io. The new type is used in the analyses where the bitsets can get huge (e.g. 10s of thousands of bits): `MaybeInitializedPlaces`, `MaybeUninitializedPlaces`, and `EverInitializedPlaces`. Some refactoring was required in `rustc_mir_dataflow`. All existing analysis domains are either `BitSet` or a trivial wrapper around `BitSet`, and access in a few places is done via `Borrow<BitSet>` or `BorrowMut<BitSet>`. Now that some of these domains are `ClusterBitSet`, that no longer works. So this commit replaces the `Borrow`/`BorrowMut` usage with a new trait `BitSetExt` containing the needed bitset operations. The impls just forward these to the underlying bitset type. This required fiddling with trait bounds in a few places. The commit also: - Moves `static_assert_size` from `rustc_data_structures` to `rustc_index` so it can be used in the latter; the former now re-exports it so existing users are unaffected. - Factors out some common "clear excess bits in the final word" functionality in `bit_set.rs`. - Uses `fill` in a few places instead of loops.
2022-02-19Adopt let else in more placesest31-0/+1
2022-02-15Rename `PtrKey` as `Interned` and improve it.Nicholas Nethercote-1/+2
In particular, there's now more protection against incorrect usage, because you can only create one via `Interned::new_unchecked`, which makes it more obvious that you must be careful. There are also some tests.
2022-02-01add a rustc::query_stability lintlcnr-0/+1
2021-12-07Make IdFunctor::try_map_id panic-safeAlan Egerton-0/+1
2021-12-05Stop enabling `in_band_lifetimes` in rustc_data_structuresScott McMurray-2/+0
There's a conversation in the tracking issue about possibly unaccepting `in_band_lifetimes`, but it's used heavily in the compiler, and thus there'd need to be a bunch of PRs like this if that were to happen. So here's one to see how much of an impact it has. (Oh, and I removed `nll` while I was here too, since it didn't seem needed. Let me know if I should put that back.)
2021-12-02Remove no-longer used `IdFunctor::map_id`Alan Egerton-1/+0
2021-11-27Delegate from `map_id` to `try_map_id`Alan Egerton-0/+1
2021-10-28Revert "Add rustc lint, warning when iterating over hashmaps"Mark Rousskov-1/+0
2021-10-25Auto merge of #90042 - pietroalbini:1.56-master, r=Mark-Simulacrumbors-1/+0
Bump bootstrap compiler to 1.57 Fixes https://github.com/rust-lang/rust/issues/90152 r? `@Mark-Simulacrum`
2021-10-23update cfg(bootstrap)Pietro Albini-1/+0
2021-10-15allow `potential_query_instability` everywherelcnr-0/+1
2021-10-04Rollup merge of #89508 - jhpratt:stabilize-const_panic, r=joshtriplettJubilee-1/+1
Stabilize `const_panic` Closes #51999 FCP completed in #89006 ```@rustbot``` label +A-const-eval +A-const-fn +T-lang cc ```@oli-obk``` for review (not `r?`'ing as not on lang team)
2021-10-04Stabilize `const_panic`Jacob Pratt-1/+1
2021-10-02Remove various unused feature gatesbjorn3-1/+0
2021-09-17Stabilize `Iterator::map_while`Maybe Waffle-1/+0
2021-09-10rustc: Remove local variable IDs from `Export`sVadim Petrochenkov-0/+1
Local variables can never be exported.
2021-09-08Bump stage0 compiler to 1.56Mark Rousskov-2/+1
2021-07-27Use type_alias_impl_trait instead of min in compiler and libSantiago Pastorino-1/+2
2021-07-23Sort features alphabeticallyYuki Okushi-13/+13
2021-07-23Use `map_while` instead of `take_while` + `map`Yuki Okushi-0/+2
2021-07-22Fix VecMap::iter_mutOli Scherer-0/+1
It used to allow you to mutate the key, even though that can invalidate the map by creating duplicate keys.
2021-06-11Auto merge of #85885 - bjorn3:remove_box_region, r=cjgillotbors-2/+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-08Inline the rest of box_regionbjorn3-2/+0
2021-06-07Add VecMap to rustc_data_structuresSantiago Pastorino-0/+1
2021-05-31Remove unused feature gatesbjorn3-1/+0
2021-05-31Remove unnecessary unboxed_closures feature usagebjorn3-2/+0
It has been possible to clone closures for a while now
2021-03-30Add an Mmap wrapper to rustc_data_structuresbjorn3-0/+1
This wrapper implements StableAddress and falls back to directly reading the file on wasm32
2021-03-24Revert "Revert stabilizing integer::BITS."Mara Bos-1/+0
2021-02-27Rollup merge of #82057 - upsuper-forks:cstr, r=davidtwco,wesleywiserDylan DPC-1/+0
Replace const_cstr with cstr crate This PR replaces the `const_cstr` macro inside `rustc_data_structures` with `cstr` macro from [cstr](https://crates.io/crates/cstr) crate. The two macros basically serve the same purpose, which is to generate `&'static CStr` from a string literal. `cstr` is better because it validates the literal at compile time, while the existing `const_cstr` does it at runtime when `debug_assertions` is enabled. In addition, the value `cstr` generates can be used in constant context (which is seemingly not needed anywhere currently, though).
2021-02-20Update the bootstrap compilerJoshua Nelson-1/+0
Note this does not change `core::derive` since it was merged after the beta bump.
2021-02-14Replace const_cstr with cstr crateXidorn Quan-1/+0
2021-02-03Revert stabilizing integer::BITS.Mara Bos-0/+1
2021-01-31stabilize int_bits_constAshley Mannix-1/+0
2020-12-30Bump bootstrap compiler to 1.50 betaMark Rousskov-2/+1
2020-12-26stabilize min_const_genericsBastian Kauschke-1/+1
2020-11-23Rename `optin_builtin_traits` to `auto_traits`Camelid-1/+2
They were originally called "opt-in, built-in traits" (OIBITs), but people realized that the name was too confusing and a mouthful, and so they were renamed to just "auto traits". The feature flag's name wasn't updated, though, so that's what this PR does. There are some other spots in the compiler that still refer to OIBITs, but I don't think changing those now is worth it since they are internal and not particularly relevant to this PR. Also see <https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/opt-in.2C.20built-in.20traits.20(auto.20traits).20feature.20name>.
2020-11-20Set unaligned_references lint to deny in rustc_data_structuresTyson Nottingham-0/+1
To detect misuse of private packed field in `PackedFingerprint`.
2020-11-16compiler: fold by valueBastian Kauschke-0/+2
2020-11-15Rollup merge of #79058 - dtolnay:likelymacro, r=Mark-SimulacrumJonas Schievink-6/+6
Move likely/unlikely argument outside of invisible unsafe block The previous `likely!`/`unlikely!` macros were unsound because it permits the caller's expr to contain arbitrary unsafe code. ```rust pub fn huh() -> bool { likely!(std::ptr::read(&() as *const () as *const bool)) } ``` **Before:** compiles cleanly. **After:** ```console error[E0133]: call to unsafe function is unsafe and requires unsafe function or block | 70 | likely!(std::ptr::read(&() as *const () as *const bool)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function | = note: consult the function's documentation for information on how to avoid undefined behavior ```
2020-11-14Move likely/unlikely argument outside of invisible unsafe blockDavid Tolnay-6/+6
The previous `likely!`/`unlikely!` macros were unsound because it permits the caller's expr to contain arbitrary unsafe code. pub fn huh() -> bool { likely!(std::ptr::read(&() as *const () as *const bool)) } Before: compiles cleanly. After: error[E0133]: call to unsafe function is unsafe and requires unsafe function or block | 70 | likely!(std::ptr::read(&() as *const () as *const bool)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function | = note: consult the function's documentation for information on how to avoid undefined behavior
2020-11-14Move Steal to rustc_data_structures.Camille GILLOT-0/+1
2020-10-25Auto merge of #77476 - tgnottingham:buffered_siphasher128, r=nnethercotebors-0/+1
perf: buffer SipHasher128 This is an attempt to improve Siphasher128 performance by buffering input. Although it reduces instruction count, I'm not confident the effect on wall times, or lack-thereof, is worth the change. --- Additional notes not reflected in source comments: * Implementation choices were guided by a combination of results from rustc-perf and micro-benchmarks, mostly the former. * ~~I tried a couple of different struct layouts that might be more cache friendly with no obvious effect.~~ Update: a particular struct layout was chosen, but it's not critical to performance. See comments in source and discussion below. * I suspect that buffering would be important to a SIMD-accelerated algorithm, but from what I've read and my own tests, SipHash does not seem very amenable to SIMD acceleration, at least by SSE.
2020-10-05Auto merge of #77171 - VFLashM:better_sso_structures, r=oli-obkbors-2/+1
Better sso structures This change greatly expands interface of MiniSet/MiniMap and renames them because they are no longer "Mini".
2020-10-03perf: buffer SipHasher128Tyson Nottingham-0/+1
2020-09-26MiniSet/MiniMap moved and renamed into SsoHashSet/SsoHashMapValerii Lashmanov-2/+1
It is a more descriptive name and with upcoming changes there will be nothing "mini" about them.
2020-09-26Remove unused #[allow(...)] statements from compiler/est31-1/+0
2020-09-25Rollup merge of #77121 - duckymirror:html-root-url, r=jyn514Jonas Schievink-1/+1
Updated html_root_url for compiler crates Closes #77103 r? @jyn514
2020-09-23/nightly/nightly-rustcErik Hofmayer-1/+1