Commit Graph

95621 Commits

Author SHA1 Message Date
Niko Matsakis
b5fb906766 fix tests and remove outdated stderr files 2019-07-02 12:15:20 -04:00
Niko Matsakis
8d39bdd5f9 integrate reverse graph and upper-bound computation 2019-07-02 12:15:20 -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
Niko Matsakis
07ee532031 improve tests with migration mode, mir mode 2019-07-02 12:15:20 -04:00
Niko Matsakis
cc581bfa0e remove old error and add an explanation 2019-07-02 12:15:20 -04:00
Niko Matsakis
ec48b4ebe2 preliminary integration of "pick constraints" into nll solver 2019-07-02 12:15:20 -04:00
Niko Matsakis
3b5a7276d2 construct pick-constraints and give them to region inference 2019-07-02 12:15:20 -04:00
Niko Matsakis
d9596692a5 implement PickConstraintSet type 2019-07-02 12:15:20 -04:00
Niko Matsakis
330cb7668c pass more than outlives constraints to constraint conversion 2019-07-02 12:15:20 -04:00
Niko Matsakis
3aad20d8f8 [WIP] fix Lift impl for Rc 2019-07-02 12:15:20 -04:00
Niko Matsakis
6ead1c8699 rename ConstraintSet to OutlivesConstraintSet 2019-07-02 12:15:20 -04:00
Niko Matsakis
ddc63ce19f propagate the pick-constraints through queries 2019-07-02 12:15:20 -04:00
Niko Matsakis
f933e0971b pass a &mut QueryRegionConstraints not just outlives constraints 2019-07-02 12:15:20 -04:00
Niko Matsakis
ec560e2c6d remove deref impl and add an index impl
The constraint set is going to be more than just a set of outlives
constraints.
2019-07-02 12:15:19 -04:00
Niko Matsakis
f673b24ba2 rename ConstraintIndex to OutlivesConstraintIndex 2019-07-02 12:15:19 -04:00
Niko Matsakis
09bba9b89d introduce QueryRegionConstraints struct 2019-07-02 12:15:19 -04:00
Niko Matsakis
7e66a96d58 introduce QueryRegionConstraints struct (no-op) 2019-07-02 12:15:19 -04:00
Niko Matsakis
fd5f7673a7 rename QueryRegionConstraint to QueryOutlivesConstraint 2019-07-02 12:15:19 -04:00
Niko Matsakis
d6ec0ae777 enforce and report pick-constraint errors
The error message here is not great.
2019-07-02 12:15:19 -04:00
Niko Matsakis
f0eebcd02f integrate pick constraints into lexical solver more completely 2019-07-02 12:15:19 -04:00
Niko Matsakis
02609b85e3 rename from "in constraint" to "pick constraint" 2019-07-02 12:15:19 -04:00
Niko Matsakis
c36205b48e add some tests, currently ICE-ing 2019-07-02 12:15:19 -04:00
Niko Matsakis
dfcd1c6328 make dup_vec optional 2019-07-02 12:15:19 -04:00
Niko Matsakis
979f566603 lexical_region_resolve: rustfmt 2019-07-02 12:15:19 -04:00
Niko Matsakis
14e23a5835 introduce an "in" constraint instead of error 2019-07-02 12:15:19 -04:00
Niko Matsakis
2eb3fcc10d introduce constrain_regions helper 2019-07-02 12:15:19 -04:00
Niko Matsakis
aab48c963a opaque_types/mod.rs: rustfmt 2019-07-02 12:15:19 -04:00
Simon Sapin
7454b29efc HashMap is UnwindSafe
Fixes https://github.com/rust-lang/rust/issues/62301, a regression in 1.36.0 which was caused by hashbrown using `NonZero<T>` where the older hashmap used `Unique<T>`.
2019-07-02 16:01:06 +02:00
bors
848e0a23f3 Auto merge of #61922 - tmandry:moar-generator-optimization, r=matthewjasper
Don't store locals that have been moved from in generators

This avoids reserving storage in generators for locals that are moved
out of (and not re-initialized) prior to yield points. Fixes #59123.

This adds a new dataflow analysis, `RequiresStorage`, to determine whether the storage of a local can be destroyed without being observed by the program. The rules are:

1. StorageLive(x) => mark x live
2. StorageDead(x) => mark x dead
3. If a local is moved from, _and has never had its address taken_, mark it dead
4. If (any part of) a local is initialized, mark it live'

This is used to determine whether to save a local in the generator object at all, as well as which locals can be overlapped in the generator layout.

Here's the size in bytes of all testcases included in the change, before and after the change:

async fn test    |Size before |Size after
-----------------|------------|----------
single           | 1028       | 1028
single_with_noop | 2056       | 1032
joined           | 5132       | 3084
joined_with_noop | 8208       | 3084

generator test              |Size before |Size after
----------------------------|------------|----------
move_before_yield           | 1028       | 1028
move_before_yield_with_noop | 2056       | 1032
overlap_move_points         | 3080       | 2056

## Future work

Note that there is a possible extension to this optimization, which modifies rule 3 to read: "If a local is moved from, _**and either has never had its address taken, or is Freeze and has never been mutably borrowed**_, mark it dead." This was discussed at length in #59123 and then #61849. Because this would cause some behavior to be UB which was not UB before, it's a step that needs to be taken carefully.

A more immediate priority for me is inlining `std::mem::size_of_val(&x)` so it becomes apparent that the address of `x` is not taken. This way, using `size_of_val` to look at the size of your inner futures does not affect the size of your outer future.

cc @cramertj @eddyb @Matthias247 @nikomatsakis @RalfJung @Zoxc
2019-07-02 12:25:00 +00:00
Aleksey Kladov
dc088b26ce refactor check_for_substitution
No behavior change, just flatter and simpler code
2019-07-02 11:16:33 +03: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
Chris Gregory
eddfad3140 Fix import of take in collapse_docs.rs 2019-07-01 20:21:53 -07:00
Chris Gregory
1443abcdef Revert change in compiletest 2019-07-01 20:21:53 -07:00
Chris Gregory
b0c199a969 Enable mem_take feature in relevant crates 2019-07-01 20:21:53 -07:00
Chris Gregory
636f5e6d11 Convert more usages over 2019-07-01 20:21:12 -07:00
Chris Gregory
8a3797b736 Use mem::take instead of mem::replace with default 2019-07-01 20:21:12 -07:00
Mark Rousskov
353b5d413e Fix michaelwoerister's mailmap 2019-07-01 20:23:35 -04:00
bors
99abdfa0b5 Auto merge of #62279 - pietroalbini:fix-azure-crlf, r=alexcrichton
ci: explicitly disable CRLF conversion on Windows

The Azure image enables CRLF conversion on Windows builders, but that caused regressions both in our test suite (the miri test suite broke) and in the ecosystem, since we started shipping install scripts with CRLF endings instead of the old LF. The [Godbolt Compiler Explorer](https://godbolt.org/) is one such case of breakage.

This adds a step to the build explicitly disabling the conversion before the repository is checked out.

r? @alexcrichton
cc @gnzlbg
2019-07-01 22:33:54 +00:00
Ralf Jung
b49fb76dba miri realloc: do not require giving old size+align 2019-07-01 23:48:58 +02:00
Pietro Albini
239a404cae
ci: explicitly disable CRLF conversion on Windows
The Azure image enables CRLF conversion on Windows builders, but that
caused regressions both in our test suite (the miri test suite broke)
and in the ecosystem, since we started shipping install scripts with
CRLF endings instead of the old LF. The Godbolt Compiler Explorer is one
such case of breakage.

This adds a step to the build explicitly disabling the conversion before
the repository is checked out.
2019-07-01 21:57:08 +02:00
Tyler Mandry
a68e2c7161 Clean up extra lifetime, add assertions 2019-07-01 12:19:30 -07:00
bors
17e62f77f9 Auto merge of #62267 - GuillaumeGomez:revert-implicit-option-return, r=Centril
Revert "implicit `Option`-returning doctests"

Reverts #61279 as discussed in #61360.

cc @Centril
2019-07-01 18:49:30 +00:00
bors
6ea4036cd2 Auto merge of #62247 - pietroalbini:finish-azure-migration, r=Mark-Simulacrum
ci: finish the migration to azure

This moves to azure the last builders as we discussed on Discord last night.

r? @alexcrichton
2019-07-01 15:14:16 +00:00
Pietro Albini
dc9d2b34df
bump miri to fix line endings on azure 2019-07-01 17:12:31 +02:00
Igor Matuszewski
8c96088853
Update RLS to disable spurious client_find_definitions test
Since switching CI to Azure Pipelines it seems that this test seems
to fail more consistently, so let's disable that for now. It helps
that we have less than a week before release - we disallow PRs that
break the tools to land in this period, so this makes landing critical
PRs smoother  now.

r? @alexcrichton
2019-07-01 17:12:29 +02:00
Pietro Albini
1992931c9e
ci: finish the migration to azure 2019-07-01 17:12:28 +02:00
Guillaume Gomez
a683bb1754 Revert "implicit Option-returning doctests"
This reverts commit 6bb6c001be.
2019-07-01 16:41:37 +02:00
John Kåre Alsaker
8d6b1d10d4 Clean up inherent_impls 2019-07-01 14:53:58 +02:00