Commit Graph

69710 Commits

Author SHA1 Message Date
Niko Matsakis
09b44bbe77 IndexVec: add '_ to make clear where borrowing is happening 2017-11-16 05:57:45 -05:00
Niko Matsakis
72675d82d7 replace RegionIndex with RegionVid (which now impls Idx) 2017-11-16 05:57:45 -05:00
Niko Matsakis
89c1b6009b replace usize with RegionIndex in indices map 2017-11-16 05:57:45 -05:00
Niko Matsakis
ad93b695d1 MIR typeck: refactor to track region constraints 2017-11-16 05:57:45 -05:00
Niko Matsakis
37945fe3e8 MIR typeck: rustfmt 2017-11-16 05:57:44 -05:00
Niko Matsakis
034018cd90 rustfmt lexical_region_resolve 2017-11-16 05:57:44 -05:00
Niko Matsakis
1430a600de add method take_and_reset_region_constraints to InferCtxt 2017-11-16 05:57:44 -05:00
Niko Matsakis
1efcf1a115 split the var_origins from the RegionConstraintData 2017-11-16 05:57:44 -05:00
Niko Matsakis
a8daa37df6 region_constraints: only push givens into undo-log if in a snapshot 2017-11-16 05:57:44 -05:00
Niko Matsakis
524e23ae2e make RegionVid implement Idx and use IndexVec 2017-11-16 05:57:44 -05:00
Niko Matsakis
bea6b94273 fix error messages relating to removing lint for E0276 2017-11-16 05:57:44 -05:00
Niko Matsakis
f6037f2816 separate the Collector from the Data it is collecting 2017-11-16 05:57:43 -05:00
Niko Matsakis
adf1519941 make the region_constraints field an Option
This way, we can `take()` ownership of it when we are going to resolve regions.
2017-11-16 05:57:43 -05:00
Niko Matsakis
326ec52eac rename RegionVarBindings to RegionConstraintCollector 2017-11-16 05:57:43 -05:00
Niko Matsakis
48d8f7210b infer: rename region_vars field to region_constraints 2017-11-16 05:57:43 -05:00
Niko Matsakis
23abd85138 rename region_inference module to region_constraints 2017-11-16 05:57:43 -05:00
Niko Matsakis
cff191d444 move refcells out from RegionVarBindings and up into InferCtxt 2017-11-16 05:57:42 -05:00
Niko Matsakis
63d658d87c extract the tcx out from RegionVarBindings 2017-11-16 05:57:42 -05:00
Niko Matsakis
daceedf314 region_inference: rustfmt 2017-11-16 05:57:42 -05:00
Niko Matsakis
ec48b018d6 extract storage of region values from RegionVarBindings 2017-11-16 05:57:42 -05:00
Niko Matsakis
b76978530c move RegionResolutionError into lexical_region_resolve 2017-11-16 05:57:42 -05:00
Niko Matsakis
8e9e15446f region_inference: extract taint into a sub-module 2017-11-16 05:57:41 -05:00
Niko Matsakis
9d63330b6d region_inference: tighten up pub, stop re-exporting enum variants 2017-11-16 05:57:41 -05:00
Niko Matsakis
ef5de07fc5 fix rename to block_data in type_check.rs 2017-11-16 05:57:34 -05:00
Niko Matsakis
58c77600a5 move region resolution to be a sibling of region_inference
Temporary make various fields public.
2017-11-15 16:58:14 -05:00
Niko Matsakis
467f2ea653 extract lexical region resolution into its own sub-module 2017-11-15 16:50:32 -05:00
Niko Matsakis
efa09dbea5 modify MIR type-checker to process obligations as they are incurred 2017-11-15 16:50:32 -05:00
Niko Matsakis
9e8abd704a apply rustfmt to type_check 2017-11-15 16:50:30 -05:00
Niko Matsakis
6d672961fb thread location info through mir typeck (but do not use) 2017-11-15 16:49:23 -05:00
Niko Matsakis
15a2dfa324 move the OutlivesEnvironment into infer so that nll can use it
Unquestionably there is more cleanup to be done, but I'm not sure what
it should look like yet, so leaving it roughly as is.
2017-11-15 16:49:22 -05:00
Niko Matsakis
56e5eb5fd4 rename mod region_obligations to outlives::obligations 2017-11-15 16:49:22 -05:00
Niko Matsakis
0c81d0158f extract out the implied bounds code from regionck 2017-11-15 16:49:22 -05:00
Niko Matsakis
b587c1a024 regionck: only add implied bounds from root fn to free_region_map 2017-11-15 16:49:22 -05:00
Niko Matsakis
3cc44a569d do not invoke required_region_bounds in region_obligations
Instead, just search the param env predicates directly. This is
equivalent to what we were doing before but more efficient.
2017-11-15 16:49:22 -05:00
Niko Matsakis
e0630e8683 refactor how we extract outlives bounds from trait definitions
This new way is **slightly** less expressive (I would be shocked if it
affects any code, though) when it comes to higher-ranked bounds or a
few other weird tricks. But we don't handle those consistently
regardless, and the new way does not require normalization and is just
wildly simpler.
2017-11-15 16:49:22 -05:00
Niko Matsakis
22cd041ba0 move the region_obligations processing code into InferCtxt 2017-11-15 16:49:21 -05:00
Niko Matsakis
d73be851fb extract regionck_outlives into a separate helper function
This helps make its inputs and outputs more clear.
2017-11-15 16:49:21 -05:00
Niko Matsakis
c925008a5c assert that we are consuming all of the region obligations
When we get around to resolving regions, we really ought to take region
obligations into account. There is one case where they are presently
being ignored. Keep ignoring them there for now but leave a TODO.
2017-11-15 16:49:21 -05:00
Niko Matsakis
0d78e40e88 convert EXTRA_REQUIREMENT_IN_IMPL into a hard error
cc #37166
2017-11-15 16:49:21 -05:00
Niko Matsakis
64206b44b9 move region constraints into inference context 2017-11-15 16:49:21 -05:00
Niko Matsakis
4afe423fbf fulfill: remove dead code 2017-11-15 16:49:20 -05:00
bors
88a28ff602 Auto merge of #45936 - mikhail-m1:mir-borrowck-storage-dead, r=arielb1
add `StorageDead` handling

fix #45642
r? @arielb1
2017-11-15 16:07:48 +00:00
bors
ce2b8a4944 Auto merge of #45715 - oli-obk:clippy, r=kennytm
Reenable clippy testing

fixes #45680
2017-11-15 13:06:08 +00:00
Oliver Schneider
5319203aa3
Reenable clippy testing 2017-11-15 10:42:47 +01:00
Mikhail Modin
9e35fd262f fix test 2017-11-15 12:30:30 +03:00
Mikhail Modin
34be1516aa fix comment, remove redundant code 2017-11-15 11:21:05 +03:00
Mikhail Modin
830d65c1ff add StorageDead handling 2017-11-15 11:21:05 +03:00
bors
3707db9405 Auto merge of #45944 - eddyb:provide, r=nikomatsakis
rustc_driver: expose a way to override query providers in CompileController.

This API has been a long-time coming and will probably become the main method for custom drivers (that is, binaries other than `rustc` itself that use `librustc_driver`) to adapt the compiler's behavior.
2017-11-15 08:02:19 +00:00
bors
f93a4928c2 Auto merge of #45922 - vramana:fix-45702, r=nikomatsakis
Fix MIR borrowck EndRegion not found

Fixes #45702

- [x] Add Tests
2017-11-15 04:48:16 +00:00
bors
8a98531973 Auto merge of #45913 - sinkuu:mir-inlining-closure, r=arielb1
Handle closures correctly in MIR inlining

Fixes #45894.
2017-11-15 01:32:30 +00:00