Michael Woerister
24e54ddefa
Introduce LocalDefId which provides a type-level guarantee that the DefId is from the local crate.
2017-11-16 14:04:01 +01:00
bors
c81f201d48
Auto merge of #46028 - oli-obk:clippy, r=kennytm
...
Reenable Clippy
r? @kennytm
2017-11-16 10:59:39 +00:00
Niko Matsakis
8c109f5681
infer/outlives/obligations.rs: wrap some long lines
2017-11-16 05:58:16 -05:00
Niko Matsakis
9e29662a98
obligations.rs: rustfmt
2017-11-16 05:58:16 -05:00
Niko Matsakis
a94d2a6b88
Nit: fix typo
2017-11-16 05:58:13 -05:00
Niko Matsakis
a73d620323
Nit: reset more state after take_and_reset_data
2017-11-16 05:58:11 -05:00
Niko Matsakis
11c84c6625
Nit: improve comment to explain why we wait until regionck
2017-11-16 05:58:00 -05:00
Niko Matsakis
15739b820f
Nit: rework region obligations to a snapshotted vector
2017-11-16 05:57:56 -05:00
Niko Matsakis
f72259101f
Nit: fix wording in README
2017-11-16 05:57:51 -05:00
Niko Matsakis
5a8c1eb61a
leak the affects of closures on the free-region-map, like we used to
...
This restores the behavior of regionck with respect to the
free-region-map: that is, it collects all the relations from the fn
and its closures. This feels a bit fishy but it's the behavior we've
had for some time, and it will go away with NLL, so seems best to just
keep it.
2017-11-16 05:57:51 -05:00
Niko Matsakis
c7c2603e2c
factor out free_region_binding_scope
helper
2017-11-16 05:57:51 -05:00
Niko Matsakis
8cea0539d1
fix mir-opt NLL tests -- variable '_#0r
is now 'static
2017-11-16 05:57:50 -05:00
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