Commit Graph

590 Commits

Author SHA1 Message Date
Bastien Orivel a82f0ce54b Update parking_lot to 0.7
Unfortunately this'll dupe parking_lot until the data_structures crate
is published and be updated in rls in conjunction with crossbeam-channel
2019-02-22 13:49:19 +01:00
John Kåre Alsaker 82ec72391f Always emit an error for a query cycle 2019-02-15 03:51:47 +01:00
bors b244f61b77 Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnik
Cosmetic improvements to doc comments

This has been factored out from https://github.com/rust-lang/rust/pull/58036 to only include changes to documentation comments (throughout the rustc codebase).

r? @steveklabnik

Once you're happy with this, maybe we could get it through with r=1, so it doesn't constantly get invalidated? (I'm not sure this will be an issue, but just in case...) Anyway, thanks for your advice so far!
2019-02-12 19:09:24 +00:00
Oliver Scherer 4cfc2ce46d Use allow_internal_unstable in rustc itself 2019-02-11 15:08:17 +01:00
Alexander Regueiro c3e182cf43 rustc: doc comments 2019-02-10 23:42:32 +00:00
Taiki Endo 3e2b5a4b08 librustc_data_structures => 2018 2019-02-09 01:36:22 +09:00
Guillaume Gomez 761caa2334 Rollup merge of #58185 - GuillaumeGomez:images-url, r=SimonSapin
Remove images' url to make it work even without internet connection

Needed for local std docs mainly.

cc @SimonSapin

r? @QuietMisdreavus
2019-02-07 14:28:41 +01:00
Guillaume Gomez 8b886e07f5 Remove images' url to make it work even without internet connection 2019-02-07 11:06:19 +01:00
bors ad433894ab Auto merge of #58010 - Zoxc:parallel-passes, r=michaelwoerister
Move privacy checking later in the pipeline and make some passes run in parallel

r? @michaelwoerister
2019-02-07 09:49:08 +00:00
Nicholas Nethercote 9fcb1658ab Overhaul syntax::fold::Folder.
This commit changes `syntax::fold::Folder` from a functional style
(where most methods take a `T` and produce a new `T`) to a more
imperative style (where most methods take and modify a `&mut T`), and
renames it `syntax::mut_visit::MutVisitor`.

The first benefit is speed. The functional style does not require any
reallocations, due to the use of `P::map` and
`MoveMap::move_{,flat_}map`. However, every field in the AST must be
overwritten; even those fields that are unchanged are overwritten with
the same value. This causes a lot of unnecessary memory writes. The
imperative style reduces instruction counts by 1--3% across a wide range
of workloads, particularly incremental workloads.

The second benefit is conciseness; the imperative style is usually more
concise. E.g. compare the old functional style:
```
fn fold_abc(&mut self, abc: ABC) {
    ABC {
        a: fold_a(abc.a),
        b: fold_b(abc.b),
        c: abc.c,
    }
}
```
with the imperative style:
```
fn visit_abc(&mut self, ABC { a, b, c: _ }: &mut ABC) {
    visit_a(a);
    visit_b(b);
}
```
(The reductions get larger in more complex examples.)

Overall, the patch removes over 200 lines of code -- even though the new
code has more comments -- and a lot of the remaining lines have fewer
characters.

Some notes:

- The old style used methods called `fold_*`. The new style mostly uses
  methods called `visit_*`, but there are a few methods that map a `T`
  to something other than a `T`, which are called `flat_map_*` (`T` maps
  to multiple `T`s) or `filter_map_*` (`T` maps to 0 or 1 `T`s).

- `move_map.rs`/`MoveMap`/`move_map`/`move_flat_map` are renamed
  `map_in_place.rs`/`MapInPlace`/`map_in_place`/`flat_map_in_place` to
  reflect their slightly changed signatures.

- Although this commit renames the `fold` module as `mut_visit`, it
  keeps it in the `fold.rs` file, so as not to confuse git. The next
  commit will rename the file.
2019-02-06 09:06:27 +11:00
John Kåre Alsaker 38bcd4b42a Move privacy checking later in the pipeline and make some passes run in parallel 2019-01-30 21:19:02 +01:00
John Kåre Alsaker 975eb312ef Use multiple threads by default. Limits tests to one thread. Do some renaming. 2019-01-28 16:24:33 +01:00
Mazdak Farrokhzad 2876801d18 Rollup merge of #57652 - mark-i-m:remove-old, r=nikomatsakis
Update/remove some old readmes

r? @nikomatsakis

cc #48478

There are a bunch of READMEs with content that I would like to see a final decision made on:
- https://github.com/rust-lang/rust/tree/master/src/librustc/ty/query
- https://github.com/rust-lang/rust/tree/master/src/librustc/dep_graph
- https://github.com/rust-lang/rust/blob/master/src/librustc/infer/region_constraints
- https://github.com/rust-lang/rust/tree/master/src/librustc/infer/higher_ranked
- https://github.com/rust-lang/rust/tree/master/src/librustc/infer/lexical_region_resolve
- https://github.com/rust-lang/rust/blob/master/src/librustc_borrowck/borrowck

It's not clear how useful or obsolete any of these are. I would really appreciate if the appropriate domain experts for each of these could respond with one of (a) delete it, (b) wait for system to be remove, or (c) move it to rustc-guide. @nikomatsakis do you know who to ping for any of these (sorry, I suspect many of them are you)?
2019-01-25 01:37:00 +01:00
mark a6294b7628 update/remove some old readmes 2019-01-15 19:38:02 -06:00
John Kåre Alsaker 8ef7413f23 Optimize try_mark_green and eliminate the lock on dep node colors 2019-01-15 10:39:49 +01:00
bors 664c7797f6 Auto merge of #56614 - Zoxc:query-perf2, r=michaelwoerister
Replace LockCell with atomic types

Split from https://github.com/rust-lang/rust/pull/56509

r? @michaelwoerister
2019-01-09 11:08:14 +00:00
Pietro Albini e319f12cf4 Rollup merge of #57308 - Zoxc:controller-sync, r=michaelwoerister
Make CompileController thread-safe
2019-01-07 16:25:35 +01:00
John Paul Adrian Glaubitz 1c4823e81c flock: Use fcntl constants directly from libc crate on Unix targets
Since the values for the fcntl constants can vary from architecture
to architecture, it is better to use the values defined in the libc
crate instead of assigning literals in the flock code which would
make the assumption that all architectures use the same values.

Fixes #57007
2019-01-06 11:58:13 +01:00
John Kåre Alsaker 75b2e143f1 Make CompileController thread-safe 2019-01-03 18:14:01 +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 5b6401f09d sorted_map: add contains_key function 2018-12-10 14:11:14 +01:00
ljedrz 08c6bda3ee sorted_map: readability/whitespace fixes 2018-12-10 14:06:32 +01:00
ljedrz eb772045f8 sorted_map: add is_empty 2018-12-10 14:03:25 +01:00
ljedrz 61de47dd25 sorted_map: make the impls of Index and get match ones from BTreeMap 2018-12-10 14:03:25 +01:00
ljedrz 875ce5f851 sorted_map: change From<Iterator<I>> to FromIterator<I> 2018-12-10 14:03:25 +01:00
Nicholas Nethercote ecf6cd4b3c Upgrade smallvec to 0.6.7 and use the new may_dangle feature. 2018-12-10 09:31:27 +11:00
Alexander Regueiro ee89c088b0 Various minor/cosmetic improvements to code 2018-12-07 23:53:34 +00:00
bors 128a1fa4e1 Auto merge of #55635 - oli-obk:min_const_unsafe_fn, r=nikomatsakis
Allow calling `const unsafe fn` in `const fn` behind a feature gate

cc #55607

r? @Centril
2018-12-06 10:18:17 +00:00
Oliver Scherer 137a640d61 Automatically generate imports for newtype_index Deserialize impls 2018-12-04 10:17:37 +01:00
Oliver Scherer ec6573f33b Make newtype_index safe 2018-12-04 10:17:36 +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 2d68fa07bf Remove OpenSnapshot and CommittedSnapshot markers from SnapshotMap.
They're not strictly necessary, and they result in the `Vec` being
allocated even for the trivial (and common) case where a
`start_snapshot` is immediately followed by a `commit` or `rollback_to`.
2018-11-25 17:54:06 +11:00
Nicholas Nethercote f23c969492 Introduce in_snapshot and assert_open_snapshot methods.
This makes the two snapshot implementations more consistent with each
other and with crate `ena`.
2018-11-25 17:54:06 +11:00
Nicholas Nethercote f5624e41e8 Make commit and rollback_to methods take ownership of the snapshots.
Because they shouldn't be reused. This provides consistency with the
`ena` crate.
2018-11-25 17:54:06 +11:00
Nicholas Nethercote 7fe09a6551 Replace a .truncate(0) call with .clear(). 2018-11-25 17:54:06 +11:00
Nicholas Nethercote 9847b5cfcb Remove insert_noop.
Because it's as useless as its name suggests.

This commit also renames `UndoLog::Noop` as `UndoLog::Purged`, because
(a) that's a more descriptive name and (b) it matches the name used in
similar code in `librustc/infer/region_constraints/mod.rs`.
2018-11-25 17:54:06 +11:00
Nicholas Nethercote 1e34dfce6f Update to ena 0.11.0.
This version has some significant speed-ups relating to snapshotting.
2018-11-25 17:54:04 +11:00
kennytm 12f6a42f61 Rollup merge of #55945 - oli-obk:static_assert_arg_type, r=michaelwoerister
Ensure that the argument to `static_assert` is a `bool`

cc @eddyb
2018-11-24 01:31:51 +08:00
Eduard-Mihai Burtescu 7683180be5 rustc: implement and use Default on more types. 2018-11-21 08:11:50 +02:00
Eduard-Mihai Burtescu da622a3796 rustc: remove {FxHash,Node,DefId,HirId,ItemLocal}{Map,Set} "constructor" fns. 2018-11-21 07:27:02 +02:00
Oliver Scherer 65e6fdb92e Ensure that the static_assert! argument is a bool 2018-11-16 11:59:31 +01:00
Andreas Jonson 03aaa4b659 remove unused dependency 2018-11-16 08:46:15 +01:00
Pietro Albini 66fcb3ceb2 Rollup merge of #55901 - euclio:speling, r=petrochenkov
fix various typos in doc comments
2018-11-15 11:04:42 +01:00
Andy Russell 4e35cbb22e fix various typos in doc comments 2018-11-13 14:45:31 -05:00