Commit Graph

159 Commits

Author SHA1 Message Date
csmoe 64f61c7888 remove indexed_vec re-export from rustc_data_structures 2019-09-29 16:48:31 +00:00
csmoe d20183dbbf remove bit_set re-export from rustc_data_structures 2019-09-29 16:11:30 +00:00
csmoe 17990637b3 move bit_set into rustc_index 2019-09-29 16:11:30 +00:00
csmoe 1cff2e6557 move index_vec into rustc_index 2019-09-29 16:11:30 +00:00
Shivani Bhardwaj 800bd3a11c data_structures: Add deterministic FxHashMap and FxHashSet wrappers
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-28 14:35:20 +05:30
Mark Rousskov 2601c86487 Handle cfg(bootstrap) throughout 2019-08-14 05:39:53 -04:00
Ilija Tovilo 3a6a29b4ec
Use associated_type_bounds where applicable - closes #61738 2019-08-08 22:39:15 +02:00
Vadim Petrochenkov 73dae4eaf9 Remove derives `Encodable`/`Decodable` and unstabilize attribute `#[bench]` 2019-07-31 21:27:59 +03:00
Vadim Petrochenkov 434152157f Remove lint annotations in specific crates that are already enforced by rustbuild
Remove some random unnecessary lint `allow`s
2019-07-28 18:46:24 +03:00
Vadim Petrochenkov 614037171b cleanup: Remove `extern crate serialize as rustc_serialize`s 2019-07-23 19:20:16 +03:00
John Kåre Alsaker 0e73386a66 Use sharded maps for interning 2019-07-19 23:37:48 +02:00
Alex Crichton 345ba505ec rustc: Remove `dylib` crate type from most rustc crates
Now that procedural macros no longer link transitively to libsyntax,
this shouldn't be needed any more! This commit is an experiment in
removing all dynamic libraries from rustc except for librustc_driver
itself. Let's see how far we can get with that!
2019-07-07 03:23:00 +02:00
Mazdak Farrokhzad 485a084b45
Rollup merge of #61545 - flip1995:internal_lints, r=oli-obk
Implement another internal lints

cc #49509

This adds ~~two~~ one internal lint~~s~~:
1. LINT_PASS_IMPL_WITHOUT_MACRO: Make sure, that the `{declare,impl}_lint_pass` macro is used to implement lint passes. cc #59669
2. ~~USAGE_OF_TYCTXT_AND_SPAN_ARGS: item 2 on the list in #49509~~

~~With 2. I wasn't sure, if this lint should be applied everywhere. That means a careful review of 0955835 would be great. Also 73fb9b4 allows this lint on some functions. Should I also apply this lint there?~~

TODO (not directly relevant for review):
- [ ] https://github.com/rust-lang/rust/pull/59316#discussion_r280186517 (not sure yet, if this works or how to query for `rustc_private`, since it's not in [`Features`](https://doc.rust-lang.org/nightly/nightly-rustc/syntax/feature_gate/struct.Features.html) 🤔 cc @eddyb)
- [x] https://github.com/rust-lang/rust/pull/61735#discussion_r292389870
- [x] Check explicitly for the `{declare,impl}_lint_pass!` macros

r? @oli-obk
2019-07-05 20:26:51 +02:00
Niko Matsakis 3e01c7416a just create a binary search slice helper fn 2019-07-02 12:25:16 -04:00
Niko Matsakis 89a205bf44 add a `VecMap` data structure 2019-07-02 12:15:21 -04:00
flip1995 7de6f54728
Turn internal lints into tool lints 2019-06-24 10:45:21 +02:00
flip1995 65c81dee75
Allow default_hash_types in some crates 2019-06-24 10:45:20 +02:00
John Kåre Alsaker 51938c61f6 Make the rustc driver and interface demand driven 2019-03-10 04:49:45 +01:00
John Kåre Alsaker 892fed9d08 Add support for using a jobserver with Rayon 2019-03-01 01:15:37 +01:00
John Kåre Alsaker 82ec72391f Always emit an error for a query cycle 2019-02-15 03:51:47 +01:00
Taiki Endo 3e2b5a4b08 librustc_data_structures => 2018 2019-02-09 01:36:22 +09:00
Guillaume Gomez 8b886e07f5 Remove images' url to make it work even without internet connection 2019-02-07 11:06:19 +01:00
John Kåre Alsaker 03b7cec2de Replace LockCell with atomic types 2018-12-29 12:46:37 +01:00
Mark Rousskov 2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
kennytm 5e727a43cb
Rollup merge of #57034 - Zoxc:query-perf8, r=michaelwoerister
Inline tweaks

r? @michaelwoerister
2018-12-23 02:12:20 +08:00
John Kåre Alsaker 4f30a24e42 Inline tweaks 2018-12-21 12:09:43 +01:00
Scott McMurray 7b6cf6e87b Stabilize Vec(Deque)::resize_with
Closes #41758
2018-12-19 22:00:25 -08:00
John Kåre Alsaker c66b84457f Tweak query code for performance 2018-12-17 08:53:01 +01:00
ljedrz 651373c13d data_structures: remove tuple_slice 2018-12-03 17:33:06 +01:00
John Kåre Alsaker e955dbca99 Use raw_entry for more efficient interning 2018-11-29 15:56:45 +01:00
Nicholas Nethercote ab8a947fa0 Move `static_assert!` into librustc_data_structures.
This means it can be used by more crates.
2018-11-13 06:21:57 +11:00
Alex Crichton d0060d72e5 Bump nightly to 1.32.0
* Also update the bootstrap compiler
* Update cargo to 1.32.0
* Clean out stage0 annotations
2018-10-31 11:53:50 -07:00
Scott McMurray 37393576ec Stabilize impl_header_lifetime_elision in 2015
It's already stable in 2018; this finishes the stabilization.
2018-10-19 21:57:52 -07:00
Diogo Sousa 3fc275df6c Added graphviz visualization for obligation forests.
This can be a big help when debugging the trait resolver.
2018-10-14 16:12:07 +01:00
Josh Stone ce034951fb Bump to 1.31.0 and bootstrap from 1.30 beta 2018-09-27 20:52:53 -07:00
ljedrz 130a32fa72 Remove OneVector 2018-09-26 10:43:37 +02:00
Nicholas Nethercote 687cc292fd Remove `array_vec.rs`.
`SparseBitSet` is the only remaining user of `ArrayVec`. This commit
switches it to using `SmallVec`, and removes `array_vec.rs`.

Why the switch? Although `SparseBitSet` is size-limited and doesn't need
the ability to spill to the heap, `SmallVec` has many more features than
`ArrayVec`. In particular, it's now possible to keep `SparseBitSet`'s
elements in sorted order, which gives in-order iteration, which is a
requirement for the next commit.
2018-09-18 16:29:55 +10:00
Nicholas Nethercote 266e2d3d69 Merge indexed_set.rs into bitvec.rs, and rename it bit_set.rs.
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-09-18 07:08:09 +10:00
bors 7896af9508 Auto merge of #54177 - nnethercote:streamline-bit-stuff, r=Mark-Simulacrum
Remove bitslice.rs

As the comment in `bitslice.rs` says:

> FIXME: merge with `bitvec`
2018-09-15 06:36:22 +00:00
Nicholas Nethercote b697409f10 Remove bitslice.rs.
This requires the following changes.

- It moves parts of bitslice.rs into bitvec.rs: `bitwise()`,
  `BitwiseOperator`, `bits_to_string()`.

- It changes `IdxSet` to just be a wrapper around `BitArray`.

- It changes `BitArray` and `BitVec` to use `usize` words instead of
  `u128` words. (`BitSlice` and `IdxSet` already use `usize`.) Local
  profiling showed `usize` was better.

- It moves some operations from `IdxSet` into `BitArray`:
  `new_filled()`, `clear()`, `set_up_to()`, `trim_to()` (renamed
  `clear_above()`), `words()` and `words_mut()`, `encode()` and
  `decode(). The `IdxSet` operations now just call the `BitArray`
  operations.

- It replaces `BitArray`'s iterator implementation with `IdxSet`'s,
  because the latter is more concise. It also removes the buggy
  `size_hint` function from `BitArray`'s iterator, which counted the
  number of *words* rather than the number of *bits*. `IdxSet`'s
  iterator is now just a thin wrapper around `BitArray`'s iterator.

- It moves some unit tests from `indexed_set.rs` to `bitvec.rs`.
2018-09-13 19:36:03 +10:00
toidiu 731f4efae5 stabalize infer outlives requirements (RFC 2093).
Co-authored-by: nikomatsakis
2018-09-11 11:40:04 -04:00
Nicholas Nethercote 8cecfa62e8 Remove `AccumulateVec` and its uses.
It's basically just a less capable version of `SmallVec`.
2018-08-29 08:32:11 +10:00
bors 83ddc33347 Auto merge of #53314 - nikomatsakis:nll-invert-liveness, r=pnkfelix
NLL: experiment with inverting liveness

I got inspired to see what would happen here.

Fixes #52460

r? @pnkfelix
2018-08-28 10:58:10 +00:00
Niko Matsakis a63ece43b3 enable feature `impl_header_lifetime_elision` 2018-08-27 13:57:55 -04:00
Niko Matsakis 12f50a6e75 implement liveness tracing, remove old liveness system 2018-08-27 13:57:55 -04:00
Niko Matsakis 73fb1622b3 check that adding infer-outlives requirement to all crates works 2018-08-24 17:10:50 -04:00
Igor Gutorov 4d81fe9243 Use optimized SmallVec implementation 2018-08-23 10:45:53 +03:00
Jakub Kozlowski 00920c0024 Stabilize macro_vis_matcher 2018-08-19 17:08:00 +01:00
ljedrz e5e6375352 Move SmallVec and ThinVec out of libsyntax 2018-08-13 22:11:57 +02:00
bors a78ae85e59 Auto merge of #53161 - michaelwoerister:cstrings, r=wesleywiser
Avoid many allocations for CStrings during codegen.

Giving in to my irrational fear of dynamic allocations. Let's see what perf says to this.
2018-08-13 11:19:07 +00:00