Niko Matsakis
9da54c1ac8
add FIXME for converting RegionVid to use newtype_index!
2017-11-16 05:57:50 -05:00
Niko Matsakis
267574c8df
convert TODO in traits into a FIXME
2017-11-16 05:57:50 -05:00
Niko Matsakis
013f88b9fb
infer/outlives: add license
2017-11-16 05:57:47 -05:00
Niko Matsakis
b383ab79c9
update READMEs to describe the new situation
...
The inference README, in particular, was VERY out of date!
2017-11-16 05:57:47 -05:00
Niko Matsakis
4b743da596
integrate NLL with MIR type-checker
2017-11-16 05:57:47 -05:00
Niko Matsakis
d9e841e756
region_infer: improved debug logging
2017-11-16 05:57:47 -05:00
Niko Matsakis
32f964cc98
renumber: debug logs, use visit_region
rather than visit_rvalue
2017-11-16 05:57:47 -05:00
Niko Matsakis
12534e9159
renumber: handle ReturnTy better
2017-11-16 05:57:47 -05:00
Niko Matsakis
5592bb7c33
MIR-dump: print return type from local_decls for _0
...
We've kind of got the same information twice in the MIR, between the
return-type field and the local-decls. Seems un-great.
2017-11-16 05:57:46 -05:00
Niko Matsakis
8d3219ed5e
erase regions in MIR borrowck when checking if type moves by default
2017-11-16 05:57:46 -05:00
Niko Matsakis
ef392bc11b
simplify lifetime annotations for MirBorrowckCtxt
2017-11-16 05:57:46 -05:00
Niko Matsakis
51ce1f9493
formalize giving ownership of region vars to region inf. context
2017-11-16 05:57:46 -05:00
Niko Matsakis
109c9a79ed
infer: extract total number of region variables from infcx
...
We are heading towards deeper integration with the region inference
system in infcx; in particular, prior to the creation of the
`RegionInferenceContext`, it will be the "owner" of the set of region
variables.
2017-11-16 05:57:46 -05:00
Niko Matsakis
a87d1bbb93
infer: give access to region variable origins
2017-11-16 05:57:45 -05:00
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