Commit Graph

680 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
5761fc759a
Rollup merge of #62744 - llogiq:tiny-list-refactor, r=eddyb
Refactor `TinyList::contains` and `len` to iterate instead of recurse

None
2019-08-25 02:44:58 +02:00
Mark Rousskov
2601c86487 Handle cfg(bootstrap) throughout 2019-08-14 05:39:53 -04:00
Andre Bogus
45f14a8c90 refactor len and contains to iterate instead of recurse 2019-08-13 22:02:52 +02:00
Andre Bogus
070c83d5a9 add contains benchmarks 2019-08-13 21:55:55 +02:00
Ilija Tovilo
3a6a29b4ec
Use associated_type_bounds where applicable - closes #61738 2019-08-08 22:39:15 +02:00
Vadim Petrochenkov
62ec2cb7ac Remove some more cfg(test)s 2019-08-02 02:40:01 +03:00
Vadim Petrochenkov
e118eb6c79 librustc_data_structures: Unconfigure tests during normal build 2019-08-02 01:59:01 +03:00
Vadim Petrochenkov
73dae4eaf9 Remove derives Encodable/Decodable and unstabilize attribute #[bench] 2019-07-31 21:27:59 +03:00
bors
c7312fe4ff Auto merge of #63090 - Centril:rollup-xnjwm2h, r=Centril
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-28 20:22:42 +00:00
Vadim Petrochenkov
676d282dd3 Deny unused_lifetimes through rustbuild 2019-07-28 18:47:02 +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
61729b3bf0 tidy: Cleanup the directory whitelist 2019-07-28 15:07:16 +03:00
Mazdak Farrokhzad
5a7db0e19a
Rollup merge of #62901 - petrochenkov:serde, r=Centril
cleanup: Remove `extern crate serialize as rustc_serialize`s
2019-07-25 01:05:03 +02:00
Samy Kacimi
66815c613a
normalize use of backticks for compiler messages in remaining modules
https://github.com/rust-lang/rust/issues/60532
2019-07-23 23:09:59 +02:00
Vadim Petrochenkov
614037171b cleanup: Remove extern crate serialize as rustc_serializes 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
Mazdak Farrokhzad
791ceb6a9c
Rollup merge of #62651 - matthewjasper:rustc-macro-hygiene, r=petrochenkov
Make some rustc macros more hygienic
2019-07-13 16:18:41 +02:00
Matthew Jasper
313ba7c4d1 Make newtype_index hygienic and use allow_internal_unstable 2019-07-13 10:25:57 +01:00
John Kåre Alsaker
498bdc9b42 Add an AtomicCell abstraction 2019-07-10 17:04:42 +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
Mark Rousskov
8a7dded1a2 Switch master to 1.38 2019-07-04 11:26:57 -04:00
Jeremy Stucki
3cd4df70a5
Add missing lifetime specifier 2019-07-03 10:01:02 +02:00
Jeremy Stucki
ec711767a7
Remove needless lifetimes 2019-07-03 10:01:02 +02:00
Jeremy Stucki
d50a3a7b86
Remove needless lifetimes 2019-07-03 10:01:01 +02:00
Jeremy Stucki
6ae80cf23f
Remove needless lifetimes 2019-07-03 10:01:01 +02:00
Niko Matsakis
0dd074e854 more centril nits 2019-07-02 12:25:23 -04:00
Niko Matsakis
fb2c997d4e fix silly bugs in binary_search_util test 2019-07-02 12:25:22 -04:00
Niko Matsakis
adba6a8f90 address nits by mattewjasper 2019-07-02 12:25:21 -04: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
Niko Matsakis
a18c779fa2 pacify the mercilous tidy
long lines, trailing newlines
2019-07-02 12:15:21 -04:00
Niko Matsakis
7fd0db7dd3 add a depth_first_search helper function 2019-07-02 12:15:20 -04:00
Niko Matsakis
4c91bb9571 introduce a VecGraph abstraction that cheaply stores graphs
This is perhaps better than the linked list approach I was using
before. Lower memory overhead, Theta(N+E) storage. Does require a
sort. =)
2019-07-02 12:15:20 -04:00
Niko Matsakis
4e85665e08 implement the graph traits for SCC 2019-07-02 12:15:20 -04:00
bors
ef064d2f66 Auto merge of #61871 - Zoxc:no-lift-branch, r=eddyb
Don't use lift to detect local types

This overlaps with https://github.com/rust-lang/rust/pull/61392.

r? @eddyb
2019-07-02 08:09:15 +00:00
Igor Matuszewski
ad62b4203c Fix clippy::precedence 2019-06-26 14:14:27 +02:00
Igor Matuszewski
33f58baf6e Fix clippy::redundant_closure 2019-06-26 14:11:58 +02:00
Igor Matuszewski
6c93b47c01 Fix clippy::cast_losless 2019-06-26 14:11:58 +02:00
Igor Matuszewski
12806b7050 Fix clippy::redundant_field_names 2019-06-26 13:59:58 +02:00
John Kåre Alsaker
8465daf982 Check for local types in writeback with debug assertions 2019-06-26 13:04:06 +02:00
bors
8aa42ed7c2 Auto merge of #61787 - ecstatic-morse:dataflow-split-block-sets, r=pnkfelix
rustc_mir: Hide initial block state when defining transfer functions

This PR addresses [this FIXME](2887008e0c/src/librustc_mir/dataflow/mod.rs (L594-L596)).

This makes `sets.on_entry` inaccessible in `{before_,}{statement,terminator}_effect`. This field was meant to allow implementors of `BitDenotation` to access the initial state for each block (optionally with the effect of all previous statements applied via `accumulates_intrablock_state`) while defining transfer functions.  However, the ability to set the initial value for the entry set of each basic block (except for START_BLOCK) no longer exists. As a result, this functionality is mostly useless, and when it *was* used it was used erroneously (see #62007).

Since `on_entry` is now useless, we can also remove `BlockSets`, which held the `gen`, `kill`, and `on_entry` bitvectors and replace it with a `GenKill` struct. Variables of this type are called `trans` since they represent a transfer function. `GenKill`s are stored contiguously in `AllSets`, which reduces the number of bounds checks and may improve cache performance: one is almost never accessed without the other.

Replacing `BlockSets` with `GenKill` allows us to define some new helper functions which streamline dataflow iteration and the dataflow-at-location APIs. Notably, `state_for_location` used a subtle side-effect of the `kill`/`kill_all` setters to apply the transfer function, and could be incorrect if a transfer function depended on effects of previous statements in the block on `gen_set`.

Additionally, this PR merges `BitSetOperator` and `InitialFlow` into one trait. Since the value of `InitialFlow` defines the semantics of the `join` operation, there's no reason to have seperate traits for each. We can add a default impl of `join` which branches based on `BOTTOM_VALUE`.  This should get optimized away.
2019-06-24 20:44:18 +00: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
Mazdak Farrokhzad
74380b3336
Rollup merge of #62068 - ia0:fix_meta_var, r=petrochenkov
Fix meta-variable binding errors in macros

The errors are either:
- The meta-variable used in the right-hand side is not bound (or defined) in the
  left-hand side.
- The meta-variable used in the right-hand side does not repeat with the same
  kleene operator as its binder in the left-hand side. Either it does not repeat
  enough, or it uses a different operator somewhere.

This change should have no semantic impact.

Found by https://github.com/rust-lang/rust/pull/62008
2019-06-23 01:59:20 +02:00
Julien Cretin
b8106b59d2 Fix meta-variable binding errors in macros
The errors are either:
- The meta-variable used in the right-hand side is not bound (or defined) in the
  left-hand side.
- The meta-variable used in the right-hand side does not repeat with the same
  kleene operator as its binder in the left-hand side. Either it does not repeat
  enough, or it uses a different operator somewhere.

This change should have no semantic impact.
2019-06-23 01:30:41 +02:00
Dylan MacKenzie
c8cbd4fc78 Merge BitSetOperator and InitialFlow into one trait.
Since the value of `InitialFlow` defines the semantics of the `join`
operation, there's no reason to have seperate traits for each. We can
add a default impl of `join` which branches based on `BOTTOM_VALUE`.
This should get optimized away.
2019-06-22 10:18:19 -07:00
bors
4a365a29d6 Auto merge of #61020 - HeroicKatora:master, r=matthewjasper
librustc_data_structures: Speedup union of sparse and dense hybrid set

This optimization speeds up the union of a hybrid bitset when that
switches it from a sparse representation to a dense bitset. It now
clones the dense bitset and integrate only the spare elements instead of
densifying the sparse bitset, initializing all elements, and then a
union on two dense bitset, touching all words a second time.

It's not completely certain if the added complexity is worth it but I would
like to hear some feedback in any case. Benchmark results from my machine:

```
Now:  bit_set::union_hybrid_sparse_to_dense ... bench:          72 ns/iter (+/- 5)
Previous: bit_set::union_hybrid_sparse_to_dense ... bench:          90 ns/iter (+/- 6)
```

This being the second iteration of trying to improve the speed, since I missed the return value in the first, and forgot to run the relevant tests. Oops.
2019-06-22 15:12:15 +00:00
bors
4edff843dd Auto merge of #61347 - Centril:stabilize-underscore_const_names, r=petrochenkov
Stabilize underscore_const_names in 1.37.0

You are now permitted to write:

```rust
const _: $type_expression = $term_expression;
```

That is, we change the [grammar of items](9d1984d7ae/grammar/item.lyg (L3-L42)), as written in [the *`.lyg`* notation](263bf161da (grammar)), from:

```java
Item = attrs:OuterAttr* vis:Vis? kind:ItemKind;
ItemKind =
  | ...
  | Const:{ "const" name:IDENT ":" ty:Type "=" value:Expr ";" }
  | ...
  ;
```

into:

```java
Item = attrs:OuterAttr* vis:Vis? kind:ItemKind;
ItemKind =
  | ...
  | Const:{ "const" name:IdentOrUnderscore ":" ty:Type "=" value:Expr ";" }
  | ...
  ;

IdentOrUnderscore =
  | Named:IDENT
  | NoName:"_"
  ;
```

r? @petrochenkov
2019-06-16 20:33:55 +00:00
chansuke
0d77084eff Separate librustc_data_structures module 2019-06-16 14:17:01 +03:00