about summary refs log tree commit diff
path: root/src/librustc_data_structures
AgeCommit message (Collapse)AuthorLines
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
2019-09-23Add cycle detection for graphsDylan MacKenzie-1/+224
2019-09-20Rename a variable.Nicholas Nethercote-2/+2
Because the meaning of this `index` variable is quite different to all the other `index` variables in this file.
2019-09-20Rename `waiting_cache`.Nicholas Nethercote-14/+14
The name `waiting_cache` sounds like it is related to the states `NodeState::Waiting`, but it's not; the cache holds nodes of various states. This commit changes it to `active_state`.
2019-09-20Rename a loop variable.Nicholas Nethercote-7/+7
We normally use `index` for indices to `ObligationForest::nodes`, but this is a `Nodes::dependents` index.
2019-09-20Remove some unnecessary `backtrace` intermediate variables.Nicholas Nethercote-4/+2
2019-09-20Upgrade to ena-0.13.1 and use the new `inlined_probe_value` function.Nicholas Nethercote-1/+1
This is a big speed win for `keccak` and `inflate`.
2019-09-20Reorder the state handling in `process_cycles()`.Nicholas Nethercote-6/+9
This gives a slight speed-up.
2019-09-17Rename some index variables.Nicholas Nethercote-44/+44
Now that all indices have type `usize`, it makes sense to be more consistent about their naming. This commit removes all uses of `i` in favour of `index`.
2019-09-17Remove `NodeIndex`.Nicholas Nethercote-36/+27
The size of the indices doesn't matter much here, and having a `newtype_index!` index type without also using `IndexVec` requires lots of conversions. So this commit removes `NodeIndex` in favour of uniform use of `usize` as the index type. As well as making the code slightly more concise, it also slightly speeds things up.
2019-09-17Move a `Node`'s parent into the descendents list.Nicholas Nethercote-43/+36
`Node` has an optional parent and a list of other descendents. Most of the time the parent is treated the same as the other descendents -- error-handling is the exception -- and chaining them together for iteration has a non-trivial cost. This commit changes the representation. There is now a single list of descendants, and a boolean flag that indicates if there is a parent (in which case it is first descendent). This representation encodes the same information, in a way that is less idiomatic but cheaper to iterate over for the common case where the parent doesn't need special treatment. As a result, some benchmark workloads are up to 2% faster.
2019-09-17Rollup merge of #64500 - nnethercote:ObligForest-fixups, r=nikomatsakisMazdak Farrokhzad-167/+148
Various `ObligationForest` improvements These commits make the code both nicer and faster. r? @nikomatsakis
2019-09-16Auto merge of #64381 - mati865:rand, r=alexcrichtonbors-1/+1
Upgrade parking_lot and tempfile rustc dependencies This should be last piece to unbreak `rustc` in https://github.com/rust-lang/rust/issues/63848
2019-09-16Move `impl Node` just after `struct Node`.Nicholas Nethercote-16/+16
2019-09-16Minor comment tweaks.Nicholas Nethercote-10/+6
2019-09-16Use `retain` for `waiting_cache` in `apply_rewrites()`.Nicholas Nethercote-6/+4
It's more concise, more idiomatic, and measurably faster.
2019-09-16Use iterators in `error_at` and `process_cycle`.Nicholas Nethercote-16/+18
This makes the code a little faster, presumably because bounds checks aren't needed on `nodes` accesses. It requires making `scratch` a `RefCell`, which is not unreasonable.
2019-09-16Add comments about `waiting_cache`.Nicholas Nethercote-2/+14
2019-09-16Fix incorrect comment about contents of a `Node`.Nicholas Nethercote-5/+5
2019-09-16Fix some out-of-date names of things in comments.Nicholas Nethercote-7/+7
2019-09-16Remove out-of-date comments.Nicholas Nethercote-16/+0
These refer to code that no longer exists.
2019-09-16Factor out repeated `self.nodes[i]` expressions.Nicholas Nethercote-15/+14
2019-09-16Redefine `NodeIndex` as a `newtype_index!`.Nicholas Nethercote-42/+35
This commit removes the custom index implementation of `NodeIndex`, which probably predates `newtype_index!`. As well as eliminating code, it improves the debugging experience, because the custom implementation had the property of being incremented by 1 (so it could use `NonZeroU32`), which was incredibly confusing if you didn't expect it. For some reason, I also had to remove an `unsafe` block marker from `from_u32_unchecked()` that the compiler said was now unnecessary.
2019-09-16Name index variables consistently.Nicholas Nethercote-50/+47
Those with type `usize` are now called `i`, those with type `NodeIndex` are called `index`.
2019-09-13Inline `mark_neighbours_as_waiting_from`.Nicholas Nethercote-4/+13
This function is very hot, doesn't get inlined because it's recursive, and the function calls are significant. This commit splits it into inlined and uninlined variants, and uses the inlined variant for the hot call site. This wins several percent on a few benchmarks.
2019-09-11Upgrade parking_lot and tempfile rustc dependenciesMateusz Mikuła-1/+1
2019-08-25Rollup merge of #62744 - llogiq:tiny-list-refactor, r=eddybMazdak Farrokhzad-46/+45
Refactor `TinyList::contains` and `len` to iterate instead of recurse None
2019-08-14Handle cfg(bootstrap) throughoutMark Rousskov-1/+1
2019-08-13refactor `len` and `contains` to iterate instead of recurseAndre Bogus-40/+16
2019-08-13add contains benchmarksAndre Bogus-6/+29
2019-08-08Use associated_type_bounds where applicable - closes #61738Ilija Tovilo-2/+7
2019-08-02Remove some more `cfg(test)`sVadim Petrochenkov-12/+5
2019-08-02librustc_data_structures: Unconfigure tests during normal buildVadim Petrochenkov-1168/+1180
2019-07-31Remove derives `Encodable`/`Decodable` and unstabilize attribute `#[bench]`Vadim Petrochenkov-1/+1
2019-07-28Auto merge of #63090 - Centril:rollup-xnjwm2h, r=Centrilbors-10/+22
Rollup of 8 pull requests Successful merges: - #61856 (Lint attributes on function arguments) - #62360 (Document that ManuallyDrop::drop should not called more than once) - #62392 (Update minifier-rs version) - #62871 (Explicit error message for async recursion.) - #62995 (Avoid ICE when suggestion span is at Eof) - #63053 (SystemTime docs: recommend Instant for elapsed time) - #63081 (tidy: Cleanup the directory whitelist) - #63088 (Remove anonymous_parameters from unrelated test) Failed merges: r? @ghost
2019-07-28Deny `unused_lifetimes` through rustbuildVadim Petrochenkov-0/+5
2019-07-28Remove lint annotations in specific crates that are already enforced by ↵Vadim Petrochenkov-1/+0
rustbuild Remove some random unnecessary lint `allow`s
2019-07-28tidy: Cleanup the directory whitelistVadim Petrochenkov-10/+22
2019-07-25Rollup merge of #62901 - petrochenkov:serde, r=CentrilMazdak Farrokhzad-29/+18
cleanup: Remove `extern crate serialize as rustc_serialize`s
2019-07-23normalize use of backticks for compiler messages in remaining modulesSamy Kacimi-6/+6
https://github.com/rust-lang/rust/issues/60532
2019-07-23cleanup: Remove `extern crate serialize as rustc_serialize`sVadim Petrochenkov-29/+18
2019-07-19Use sharded maps for interningJohn Kåre Alsaker-59/+129
2019-07-13Rollup merge of #62651 - matthewjasper:rustc-macro-hygiene, r=petrochenkovMazdak Farrokhzad-16/+17
Make some rustc macros more hygienic