about summary refs log tree commit diff
path: root/src/librustc_data_structures
AgeCommit message (Collapse)AuthorLines
2019-12-02Undo minor changes that weren't needed, fix one lifetime typoPaul Daniel Faria-0/+1
2019-12-02Account for new maybe_sideeffect helper that requires predecessorsPaul Daniel Faria-34/+3
2019-12-02Move predecessor cache outside of Body, use wrapper types to manage Cache ↵Paul Daniel Faria-11/+42
and Body (WIP, amend this commit)
2019-11-26Fix spelling typosBrian Wignall-1/+1
2019-11-23Rollup merge of #66657 - ollie27:rustdoc_flock_panic, r=GuillaumeGomezMazdak Farrokhzad-12/+0
rustdoc: Don't panic when failing to write .lock file It can be treated like any other unexpected IO error. I couldn't think of a good way to add a test for this unfortunately. r? @GuillaumeGomez
2019-11-23rustdoc: Don't panic when failing to write .lock fileOliver Middleton-12/+0
It can be treated like any other unexpected IO error.
2019-11-17Implement HashStable for RangeInclusive.Camille GILLOT-0/+10
2019-11-15Rollup merge of #66013 - nnethercote:avoid-hashing-twice-in-get_query, r=ZoxcYuki Okushi-0/+6
Avoid hashing the key twice in `get_query()`. For a single-threaded parallel compiler, this reduces instruction counts across several benchmarks, by up to 2.8%. The commit also adds documentation about `Sharded`'s use of `FxHasher`. r? @Zoxc
2019-11-15Make `process_obligations()` greedier.Nicholas Nethercote-10/+33
`process_obligations()` adds new nodes, but it does not process these new nodes until the next time it is called. This commit changes it so that it does process these new nodes within the same call. This change reduces the number of calls to `process_obligations()` required to complete processing, sometimes giving significant speed-ups. The change required some changes to tests. - The output of `cycle-cache-err-60010.rs` is slightly different. - The unit tests required extra cases to handle the earlier processing of the added nodes. I mostly did these in the simplest possible way, by making the added nodes be ignored, thus giving outcomes the same as with the old behaviour. But I changed `success_in_grandchildren()` more extensively so that some obligations are completed earlier than they used to be.
2019-11-12Register queries with self profiler in rustc_interfaceMark Rousskov-0/+6
2019-11-12Move self-profile infrastructure to data structuresMark Rousskov-0/+318
The single dependency on queries (QueryName) can be fairly easily abstracted via a trait and this further decouples Session from librustc (the primary goal).
2019-11-04bump smallvec to 1.0Ralf Jung-1/+1
2019-11-04Avoid hashing the key twice in `get_query()`.Nicholas Nethercote-0/+6
For a single-threaded parallel compiler, this reduces instruction counts across several benchmarks, by up to 2.8%. The commit also adds documentation about `Sharded`'s use of `FxHasher`.
2019-11-01Rollup merge of #65997 - spastorino:fix-init_locking-rustdoc, r=Mark-SimulacrumTyler Mandry-4/+4
Fix outdated rustdoc of Once::init_locking function r? @Mark-Simulacrum related to https://github.com/rust-lang/rust/pull/65979
2019-11-01Rollup merge of #65112 - jack-t:type-parens-lint, r=varkorTyler Mandry-4/+4
Add lint and tests for unnecessary parens around types This is my first contribution to the Rust project, so I apologize if I'm not doing things the right way. The PR fixes #64169. It adds a lint and tests for unnecessary parentheses around types. I've run `tidy` and `rustfmt` — I'm not totally sure it worked right, though — and I've tried to follow the instructions linked in the readme. I tried to think through all the variants of `ast::TyKind` to find exceptions to this lint, and I could only find the one mentioned in the original issue, which concerns types with `dyn`. I'm not a Rust expert, thought, so I may well be missing something. There's also a problem with getting this to build. The new lint catches several things in the, e.g., `core`. Because `x.py` seems to build with an equivalent of `-Werror`, what would have been warnings cause the build to break. I got it to build and the tests to pass with `--warnings warn` on my `x.py build` and `x.py test` commands.
2019-10-31Fix outdated rustdoc of Once::init_locking functionSantiago Pastorino-4/+4
2019-10-30Make init_locking return a reference to the initialized dataSantiago Pastorino-6/+8
2019-10-29Add lint for unnecessary parens around typesjack-t-4/+4
2019-10-23Rollup merge of #65648 - nnethercote:rm-intersect_opt, r=nikomatsakisMazdak Farrokhzad-21/+6
Eliminate `intersect_opt`. Its fourth argument is always `Some(pred)`, so the pattern matching is unnecessary. This commit inlines and removes it. r? @nikomatsakis
2019-10-21Remove many unnecessary trait derivations.Nicholas Nethercote-11/+11
2019-10-21Eliminate `intersect_opt`.Nicholas Nethercote-21/+6
Its fourth argument is always `Some(pred)`, so the pattern matching is unnecessary. This commit inlines and removes it.
2019-10-21Remove unnecessary `Hash` bounds from various types.Nicholas Nethercote-5/+5
2019-10-17Use a sharded dep node to dep node index mapJohn Kåre Alsaker-7/+23
2019-10-14Rename serial_join and serial_scope to join and scopeSantiago Pastorino-25/+22
2019-10-14Move serial_scope and serial_join to parallel_compiler = falseSantiago Pastorino-23/+23
2019-10-14Minor comment tweaksSantiago Pastorino-2/+2
2019-10-07Rebase rustc-rayon on rayon-1.2Josh Stone-2/+2
See also https://github.com/rust-lang/rustc-rayon/pull/3
2019-10-01Rollup merge of #64942 - JohnTitor:fix-clippy, r=eddybTyler Mandry-2/+2
Fix clippy warnings * Use `match` instead of `if` chain * Remove redundant `into_iter()` * Use `copied()` instead of `map()` etc.
2019-10-01Rollup merge of #64805 - nnethercote:ObligForest-still-more, r=nikomatsakisTyler Mandry-126/+115
Still more `ObligationForest` improvements. Following on from #64627, more readability improvements, but negligible effects on speed. r? @nikomatsakis
2019-10-01Fix clippy warningsYuki Okushi-2/+2
2019-09-30Avoid the popping loop at the end of `compress()`.Nicholas Nethercote-34/+40
By collecting the done obligations (when necessary) in the main loop. This makes the code cleaner. The commit also changes the order in which successful obligations are returned -- they are now returned in the registered order, rather than reversed. Because this order doesn't actually matter, being only used by tests, the commit uses `sort()` to make the test agnostic w.r.t. the order.
2019-09-30Remove an out-of-date sentence in a comment.Nicholas Nethercote-3/+2
2019-09-30Rename `nodes_len` and use it in a few more places.Nicholas Nethercote-9/+9
2019-09-30Convert some `match` expressions to `if`s.Nicholas Nethercote-36/+21
These make the code more concise.
2019-09-30Introduce some intermediate variables that aid readability.Nicholas Nethercote-3/+5
2019-09-30Remove unnecessary uses of `ObligationForest::scratch`.Nicholas Nethercote-12/+8
They don't help performance at all, and just complicate things.
2019-09-30Use `filter` and `map` in `to_errors`.Nicholas Nethercote-11/+11
2019-09-30Tweak the control flow in `process_obligations()`.Nicholas Nethercote-4/+4
2019-09-30Inline `mark_as_waiting_from`.Nicholas Nethercote-12/+13
It has a single call site, and the code is easier to read this way.
2019-09-30Rename `node_index` as `index`.Nicholas Nethercote-2/+2
For consistency with other variables in this file.
2019-09-30Remove `NodeState::OnDfsStack`.Nicholas Nethercote-19/+19
It's not necessary; cycles (which are rare) can be detected by looking at the node stack. This change speeds things up slightly, as well as simplifying the code a little.
2019-09-29remove indexed_vec re-export from rustc_data_structurescsmoe-13/+12
2019-09-29remove bit_set re-export from rustc_data_structurescsmoe-6/+6
2019-09-29move bit_set into rustc_indexcsmoe-1355/+1
2019-09-29move index_vec into rustc_indexcsmoe-831/+2
2019-09-29Rollup merge of #64824 - Mark-Simulacrum:no-stable-hasher-result-everywhere, ↵Mazdak Farrokhzad-133/+53
r=michaelwoerister No StableHasherResult everywhere This removes the generic parameter on `StableHasher`, instead moving it to the call to `finish`. This has the side-effect of making all `HashStable` impls nicer, since we no longer need the verbose `<W: StableHasherResult>` that previously existed -- often forcing line wrapping. This is done for two reasons: * we should avoid false "generic" dependency on the result of StableHasher * we don't need to codegen two/three copies of all the HashStable impls when they're transitively used to produce a fingerprint, u64, or u128. I haven't measured, but this might actually make our artifacts somewhat smaller too. * Easier to understand/read/write code -- the result of the stable hasher is irrelevant when writing a hash impl.
2019-09-28Switch over all StableHash impls to new formatMark Rousskov-122/+46
2019-09-28StableHasher does not need to be generic over the Result typeMark Rousskov-11/+7
2019-09-28data_structures: Add deterministic FxHashMap and FxHashSet wrappersShivani Bhardwaj-0/+178
StableMap A wrapper for FxHashMap that allows to insert, remove, get and get_mut but no iteration support. StableSet A wrapper for FxHashSet that allows to insert, remove, get and create a sorted vector from a hashset but no iteration support.
2019-09-25Auto merge of #64627 - nnethercote:ObligForest-even-more, r=nikomatsakisbors-34/+35
Even more `ObligationForest` improvements Following on from #64545, more speed and readability improvements. r? @nikomatsakis