about summary refs log tree commit diff
path: root/src/librustc_data_structures/transitive_relation.rs
AgeCommit message (Collapse)AuthorLines
2020-08-30mv compiler to compiler/mark-402/+0
2020-08-14Rework `rustc_serialize`Matthew Jasper-67/+2
- Move the type parameter from `encode` and `decode` methods to the trait. - Remove `UseSpecialized(En|De)codable` traits. - Remove blanket impls for references. - Add `RefDecodable` trait to allow deserializing to arena-allocated references safely. - Remove ability to (de)serialize HIR. - Create proc-macros `(Ty)?(En|De)codable` to help implement these new traits.
2020-08-09rustc_data_structures: use IndexSet in TransitiveRelationJosh Stone-26/+13
2020-06-30Rewrite a few manual index loops with while-letJosh Stone-4/+2
There were a few instances of this pattern: ```rust while index < vec.len() { let item = &vec[index]; // ... } ``` These can be indexed at once: ```rust while let Some(item) = vec.get(index) { // ... } ``` Particularly in `ObligationForest::process_obligations`, this mitigates a codegen regression found with LLVM 11 (#73526).
2020-05-02fix rustdoc warningsTshepang Lekhonkhobe-1/+1
2019-12-22Format the worldMark Rousskov-53/+48
2019-12-06Add a way to list the base non-transitive edges in `TransitiveRelation`Remy Rakic-0/+8
2019-10-21Remove many unnecessary trait derivations.Nicholas Nethercote-3/+3
2019-09-29remove bit_set re-export from rustc_data_structurescsmoe-1/+1
2019-09-28Switch over all StableHash impls to new formatMark Rousskov-10/+4
2019-08-02librustc_data_structures: Unconfigure tests during normal buildVadim Petrochenkov-356/+2
2019-06-26Check for local types in writeback with debug assertionsJohn Kåre Alsaker-0/+4
2019-02-10rustc: doc commentsAlexander Regueiro-7/+7
2019-02-09librustc_data_structures => 2018Taiki Endo-4/+4
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-1/+1
2018-11-21rustc: implement and use Default on more types.Eduard-Mihai Burtescu-11/+12
2018-10-19Update unit testsOliver Scherer-16/+16
2018-10-19Prefer `Default::default` over `FxHash*::default` in struct constructorsOliver Scherer-3/+5
2018-10-19Deprecate the `FxHashMap()` and `FxHashSet()` constructor function hackOliver Scherer-1/+1
2018-09-18Merge indexed_set.rs into bitvec.rs, and rename it bit_set.rs.Nicholas Nethercote-5/+5
Currently we have two files implementing bitsets (and 2D bit matrices). This commit combines them into one, taking the best features from each. This involves renaming a lot of things. The high level changes are as follows. - bitvec.rs --> bit_set.rs - indexed_set.rs --> (removed) - BitArray + IdxSet --> BitSet (merged, see below) - BitVector --> GrowableBitSet - {,Sparse,Hybrid}IdxSet --> {,Sparse,Hybrid}BitSet - BitMatrix --> BitMatrix - SparseBitMatrix --> SparseBitMatrix The changes within the bitset types themselves are as follows. ``` OLD OLD NEW BitArray<C> IdxSet<T> BitSet<T> -------- ------ ------ grow - grow new - (remove) new_empty new_empty new_empty new_filled new_filled new_filled - to_hybrid to_hybrid clear clear clear set_up_to set_up_to set_up_to clear_above - clear_above count - count contains(T) contains(&T) contains(T) contains_all - superset is_empty - is_empty insert(T) add(&T) insert(T) insert_all - insert_all() remove(T) remove(&T) remove(T) words words words words_mut words_mut words_mut - overwrite overwrite merge union union - subtract subtract - intersect intersect iter iter iter ``` In general, when choosing names I went with: - names that are more obvious (e.g. `BitSet` over `IdxSet`). - names that are more like the Rust libraries (e.g. `T` over `C`, `insert` over `add`); - names that are more set-like (e.g. `union` over `merge`, `superset` over `contains_all`, `domain_size` over `num_bits`). Also, using `T` for index arguments seems more sensible than `&T` -- even though the latter is standard in Rust collection types -- because indices are always copyable. It also results in fewer `&` and `*` sigils in practice.
2018-08-13use ? to simplify `TransitiveRelation.maybe_map`Andre Bogus-6/+1
2018-08-09A few cleanups for rustc_data_structuresljedrz-9/+6
2018-07-25parameterize `BitVector` and `BitMatrix` by their index typesNiko Matsakis-4/+4
2018-02-27Make TransitiveRelation thread safe. Avoid locking by using get_mut in some ↵John Kåre Alsaker-10/+10
cases.
2017-12-04transtive_relation: fix typo in comment for `parents`Niko Matsakis-1/+1
2017-12-04extend TransitiveRelation with `parents` functionNiko Matsakis-2/+128
2017-12-04rename `greater_than` to `reachable_from`Niko Matsakis-2/+3
2017-11-02add/fix various comments to `BitMatrix`Niko Matsakis-2/+2
Notably, the (hitherto unused) `less_than` method was not at all what it purported to be. It in fact computes the opposite.
2017-09-24Point at parameter type on E0301Esteban Küber-3/+3
On "the parameter type `T` may not live long enough" error, point to the parameter type suggesting lifetime bindings: ``` error[E0310]: the parameter type `T` may not live long enough --> $DIR/lifetime-doesnt-live-long-enough.rs:28:5 | 27 | struct Foo<T> { | - help: consider adding an explicit lifetime bound `T: 'static`... 28 | foo: &'static T | ^^^^^^^^^^^^^^^ | note: ...so that the reference type `&'static T` does not outlive the data it points at --> $DIR/lifetime-doesnt-live-long-enough.rs:28:5 | 28 | foo: &'static T | ^^^^^^^^^^^^^^^ ```
2017-05-03factor variances into a proper queryNiko Matsakis-0/+14
There are now two queries: crate and item. The crate one computes the variance of all items in the crate; it is sort of an implementation detail, and not meant to be used. The item one reads from the crate one, synthesizing correct deps in lieu of the red-green algorithm. At the same time, remove the `variance_computed` flag, which was a horrible hack used to force invariance early on (e.g. when type-checking constants). This is only needed because of trait applications, and traits are always invariant anyway. Therefore, we now change to take advantage of the query system: - When asked to compute variances for a trait, just return a vector saying 'all invariant'. - Remove the corresponding "inferreds" from traits, and tweak the constraint generation code to understand that traits are always inferred.
2017-05-03make transitive relation use a hash mapNiko Matsakis-27/+42
2017-04-30intern CodeExtentsNiko Matsakis-0/+21
Make a `CodeExtent<'tcx>` be something allocated in an arena instead of an index into the `RegionMaps`.
2017-04-12ICH: Hash everything that gets encoded into crate metadata.Michael Woerister-0/+46
2017-02-28move the `FreeRegionMap` into `TypeckTables`Niko Matsakis-2/+31
2016-08-09generalize BitMatrix to be NxM and not just NxNNiko Matsakis-1/+2
2016-03-05apply rustfmt to librustc_data_structures, correcting ↵Niko Matsakis-55/+63
rust-lang-nursery/rustfmt#836
2015-08-23Fix panic in docs for librustc_data_structuresManish Goregaokar-1/+1
2015-08-21move the reverse into the iteratorNiko Matsakis-2/+2
2015-08-21missed one reference to "best"Niko Matsakis-4/+5
2015-08-21rename `best_upper_bound` to `postdom_upper_bound`Niko Matsakis-8/+8
2015-08-21remove use of swap_remove and compress the list as we go insteadNiko Matsakis-13/+12
2015-08-21nits from pnkfelixNiko Matsakis-22/+45
2015-08-21add final test case, correct one of the others (both versions producedNiko Matsakis-4/+22
same result)
2015-08-21add test cases suggested by pnkfelixNiko Matsakis-0/+82
2015-08-21clarify diagonal arrowsNiko Matsakis-0/+3
2015-08-18implement transitive relation type that can compute transitiveNiko Matsakis-0/+463
closures, upper bounds, and other fun things