about summary refs log tree commit diff
path: root/src/librustc_data_structures
AgeCommit message (Collapse)AuthorLines
2018-05-22Add SortedMap to rustc_data_structures.Michael Woerister-0/+502
2018-05-18use `reset_unifications` instead of creating new unification tableNiko Matsakis-1/+1
2018-05-18Auto merge of #50847 - Mark-Simulacrum:rollup, r=Mark-Simulacrumbors-0/+6
Rollup of 10 pull requests Successful merges: - #50387 (Remove leftover tab in libtest outputs) - #50553 (Add Option::xor method) - #50610 (Improve format string errors) - #50649 (Tweak `nearest_common_ancestor()`.) - #50790 (Fix grammar documentation wrt Unicode identifiers) - #50791 (Fix null exclusions in grammar docs) - #50806 (Add `bless` x.py subcommand for easy ui test replacement) - #50818 (Speed up `opt_normalize_projection_type`) - #50837 (Revert #49767) - #50839 (Make sure people know the book is free oline) Failed merges:
2018-05-17Auto merge of #50593 - nikomatsakis:nll-no-location, r=nikomatsakisbors-5/+32
stop considering location when computing outlives relationships This doesn't (yet?) use SEME regions, but it does ignore the location for outlives constraints. This makes (I believe) NLL significantly faster -- but we should do some benchmarks. It regresses the "get-default" family of use cases for NLL, which is a shame, but keeps the other benefits, and thus represents a decent step forward. r? @pnkfelix
2018-05-17Rollup merge of #50818 - nnethercote:faster-normalize, r=nikomatsakisMark Simulacrum-0/+6
Speed up `opt_normalize_projection_type` `opt_normalize_projection_type` is hot in the serde and futures benchmarks in rustc-perf. These two patches speed up the execution of most runs for them by 2--4%.
2018-05-17Avoid repeated HashMap lookups in `opt_normalize_projection_type`.Nicholas Nethercote-0/+6
There is a hot path through `opt_normalize_projection_type`: - `try_start` does a cache lookup (#1). - The result is a `NormalizedTy`. - There are no unresolved type vars, so we call `complete`. - `complete` does *another* cache lookup (#2), then calls `SnapshotMap::insert`. - `insert` does *another* cache lookup (#3), inserting the same value that's already in the cache. This patch optimizes this hot path by introducing `complete_normalized`, for use when the value is known in advance to be a `NormalizedTy`. It always avoids lookup #2. Furthermore, if the `NormalizedTy`'s obligations are empty (the common case), we know that lookup #3 would be a no-op, so we avoid it, while inserting a Noop into the `SnapshotMap`'s undo log.
2018-05-17Rollup merge of #50808 - SimonSapin:nonzero, r=alexcrichtonkennytm-1/+0
Stabilize num::NonZeroU* Tracking issue: https://github.com/rust-lang/rust/issues/49137
2018-05-16Stabilize num::NonZeroU*Simon Sapin-1/+0
Tracking issue: https://github.com/rust-lang/rust/issues/49137
2018-05-14Remove LazyBTreeMap.Nicholas Nethercote-109/+0
It was introduced in #50240 to avoid an allocation when creating a new BTreeMap, which gave some speed-ups. But then #50352 made that the default behaviour for BTreeMap, so LazyBTreeMap is no longer necessary.
2018-05-13Add parallel abstractionsJohn Kåre Alsaker-1/+45
2018-05-09ignore the point where the outlives requirement was addedNiko Matsakis-1/+1
2018-05-09use chunks api for SparseBitMatrix and add a `subset` fnNiko Matsakis-5/+32
2018-05-09use fmt::Result where applicableAndre Bogus-5/+5
2018-04-28Auto merge of #50240 - nnethercote:LazyBTreeMap, r=cramertjbors-0/+109
Implement LazyBTreeMap and use it in a few places. This is a thin wrapper around BTreeMap that avoids allocating upon creation. I would prefer to change BTreeMap directly to make it lazy (like I did with HashSet in #36734) and I initially attempted that by making BTreeMap::root an Option<>. But then I also had to change Iter and Range to handle trees with no root, and those types have stability markers on them and I wasn't sure if that was acceptable. Also, BTreeMap has a lot of complex code and changing it all was challenging, and I didn't have high confidence about my general approach. So I prototyped this wrapper instead and used it in the hottest locations to get some measurements about the effect. The measurements are pretty good! - Doing a debug build of serde, it reduces the total number of heap allocations from 17,728,709 to 13,359,384, a 25% reduction. The number of bytes allocated drops from 7,474,672,966 to 5,482,308,388, a 27% reduction. - It gives speedups of up to 3.6% on some rustc-perf benchmark jobs. crates.io, futures, and serde benefit most. ``` futures-check avg: -1.9% min: -3.6% max: -0.5% serde-check avg: -2.1% min: -3.5% max: -0.7% crates.io-check avg: -1.7% min: -3.5% max: -0.3% serde avg: -2.0% min: -3.0% max: -0.9% serde-opt avg: -1.8% min: -2.9% max: -0.3% futures avg: -1.5% min: -2.8% max: -0.4% tokio-webpush-simple-check avg: -1.1% min: -2.2% max: -0.1% futures-opt avg: -1.2% min: -2.1% max: -0.4% piston-image-check avg: -0.8% min: -1.1% max: -0.3% crates.io avg: -0.6% min: -1.0% max: -0.3% ``` @Gankro, how do you think I should proceed here? Is leaving this as a wrapper reasonable? Or should I try to make BTreeMap itself lazy? If so, can I change the representation of Iter and Range? Thanks!
2018-04-26rustc_target: move in syntax::abi and flip dependency.Irina Popa-0/+5
2018-04-26Implement LazyBTreeMap and use it in a few places.Nicholas Nethercote-0/+109
This is a thin wrapper around BTreeMap that avoids allocating upon creation. It speeds up some rustc-perf benchmarks by up to 3.6%.
2018-04-16Auto merge of #48945 - clarcharr:iter_exhaust, r=Kimundibors-2/+2
Replace manual iterator exhaust with for_each(drop) This originally added a dedicated method, `Iterator::exhaust`, and has since been replaced with `for_each(drop)`, which is more idiomatic. <del>This is just shorthand for `for _ in &mut self {}` or `while let Some(_) = self.next() {}`. This states the intent a lot more clearly than the identical code: run the iterator to completion. <del>At least personally, my eyes tend to gloss over `for _ in &mut self {}` without fully paying attention to what it does; having a `Drop` implementation akin to: <del>`for _ in &mut self {}; unsafe { free(self.ptr); }`</del> <del>Is not as clear as: <del>`self.exhaust(); unsafe { free(self.ptr); }` <del>Additionally, I've seen debate over whether `while let Some(_) = self.next() {}` or `for _ in &mut self {}` is more clear, whereas `self.exhaust()` is clearer than both.
2018-04-12Auto merge of #49558 - Zoxc:sync-misc, r=michaelwoeristerbors-0/+198
Even more thread-safety changes r? @michaelwoerister
2018-04-11Auto merge of #49715 - Mark-Simulacrum:deny-warnings, r=alexcrichtonbors-1/+0
Move deny(warnings) into rustbuild This permits easier iteration without having to worry about warnings being denied. Fixes #49517
2018-04-10Add a Once type for values which are only written onceJohn Kåre Alsaker-0/+129
2018-04-10Add insert_same extension to HashMapJohn Kåre Alsaker-0/+14
2018-04-10Add OneThread which only allows its inner value to be used in one threadJohn Kåre Alsaker-0/+55
2018-04-10Auto merge of #49390 - Zoxc:sync-syntax, r=michaelwoeristerbors-0/+12
More thread-safety changes r? @michaelwoerister
2018-04-08Move deny(warnings) into rustbuildMark Simulacrum-1/+0
This permits easier iteration without having to worry about warnings being denied. Fixes #49517
2018-04-05Bump the bootstrap compiler to 1.26.0 betaAlex Crichton-4/+0
Holy cow that's a lot of `cfg(stage0)` removed and a lot of new stable language features!
2018-04-04Replace manual iter exhaust with for_each(drop).Clar Charr-2/+2
2018-04-02avoid IdxSets containing garbage above the universe lengthAriel Ben-Yehuda-1/+73
This makes sure that all bits in each IdxSet between the universe length and the end of the word are all zero instead of being in an indeterminate state. This fixes a crash with RUST_LOG=rustc_mir, and is probably a good idea anyway.
2018-03-31Auto merge of #49201 - Phlosioneer:add-trivial-size-hints, r=SimonSapinbors-0/+18
Implement some trivial size_hints for various iterators This also implements ExactSizeIterator where applicable. Addresses most of the Iterator traits mentioned in #23708. I intend to do more, but I don't want to make the PR too large.
2018-03-29Move RangeArguments to {core::std}::ops and rename to RangeBoundsSimon Sapin-9/+7
These unstable items are deprecated: * The `std::collections::range::RangeArgument` reexport * The `std::collections::range` module.
2018-03-29Move alloc::Bound to {core,std}::opsSimon Sapin-1/+1
The stable reexport `std::collections::Bound` is now deprecated. Another deprecated reexport could be added in `alloc`, but that crate is unstable.
2018-03-29Stabilize underscore lifetimesTaylor Cramer-1/+1
2018-03-28Add try_write to RwLockJohn Kåre Alsaker-0/+12
2018-03-26Stabilize i128 feature tooMark Mansi-2/+1
2018-03-26Stabilize i128_typeMark Mansi-1/+1
2018-03-26Stabilize conservative_impl_traitTaylor Cramer-1/+1
2018-03-26Stabilize universal_impl_traitTaylor Cramer-1/+1
2018-03-23Rollup merge of #49030 - Zoxc:misc, r=michaelwoeristerAlex Crichton-30/+15
Misc changes from my parallel rustc branch r? @michaelwoerister
2018-03-23Rollup merge of #48265 - SimonSapin:nonzero, r=KodrAusAlex Crichton-3/+3
Add 12 num::NonZero* types for primitive integers, deprecate core::nonzero RFC: https://github.com/rust-lang/rfcs/pull/2307 Tracking issue: ~~https://github.com/rust-lang/rust/issues/27730~~ https://github.com/rust-lang/rust/issues/49137 Fixes https://github.com/rust-lang/rust/issues/27730
2018-03-20Implement some trivial size_hints for various iteratorsPhlosioneer-0/+18
This also implements ExactSizeIterator where applicable. Addresses most of the Iterator traits mentioned in #23708.
2018-03-19Convert SerializedDepGraph to be a struct-of-arraysWesley Wiser-0/+7
Fixes #47326
2018-03-17Use num::NonZero* instead of NonZero<_> in rustc and testsSimon Sapin-3/+3
2018-03-17Add OnDropJohn Kåre Alsaker-0/+8
2018-03-17Add an Default impl for LockJohn Kåre Alsaker-0/+7
2018-03-17Remove rustc_global!John Kåre Alsaker-30/+0
2018-03-15Rollup merge of #48840 - varkor:idxset-cleanup, r=pnkfelixkennytm-64/+0
Remove some unnecessary IdxSet methods This replaces `IdxSet:: reset_to_empty` with `IdxSet:: clear`, and `IdxSet::elems`/`IdxSet::each_bit` with `IdxSet::iter`. Based on some [comments on #rustc](https://botbot.me/mozilla/rustc/2018-01-23/?msg=96063396). r? @pnkfelix
2018-03-13add `canonicalize` method to `InferCtxt` [VIC]Niko Matsakis-1/+1
2018-03-09Move PROFQ_CHAN to a Session fieldJohn Kåre Alsaker-23/+0
2018-03-08Rollup merge of #48808 - Zoxc:reg-diag, r=michaelwoeristerManish Goregaokar-39/+87
Move REGISTERED_DIAGNOSTICS to a ParseSess field r? @michaelwoerister
2018-03-08Rollup merge of #48699 - frewsxcv:frewsxcv-impl-trait, r=nikomatsakisManish Goregaokar-99/+53
Replace iterator structures with `impl Trait`. Two commits: * Replace iterator structures with `impl Trait`. * Run rustfmt on `src/librustc_data_structures/graph/mod.rs`.
2018-03-08Produce instead of pointersOliver Schneider-0/+8