Vadim Petrochenkov
d333752f5c
Fix parsing of paths with fn-like generic arguments
2017-12-20 22:55:57 +03:00
Vadim Petrochenkov
eef85cf0ff
Add tests checking taht "priority" of qpath recovery is higher than unary and binary operators
2017-12-20 22:43:47 +03:00
Vadim Petrochenkov
9a68098e87
Move impls for qpath recovery trait from ast.rs
2017-12-20 22:43:47 +03:00
Niko Matsakis
3f490ca4bd
convert region-liveness-drop{-,-no-}may-dangle.rs into ui tests
...
The "match exact bits of CFG" approach was fragile and uninformative.
2017-12-20 14:38:13 -05:00
Niko Matsakis
cba82561cf
add some run-pass tests for NLL showing that things work as expected
2017-12-20 14:38:13 -05:00
Niko Matsakis
80c510e353
when using feature(nll), don't warn about AST-based region errors
...
Also, keep reporting AST-based region errors that are not occuring in
a fn body.
2017-12-20 14:38:13 -05:00
Niko Matsakis
cfa4ffa374
document and tweak the nll, use_mir, etc helpers
...
In particular, -Znll might as well imply -Zborrowck=mir by default,
just like `#![feature(nll)]` does.
Also, if NLL is in use, no reason to emit end regions. The NLL pass
just strips them out anyway.
2017-12-20 14:38:13 -05:00
Santiago Pastorino
e980fb8bef
feature nll implies borrowck=mir
2017-12-20 14:38:13 -05:00
Santiago Pastorino
2019d69f61
feature nll implies two-phase-borrows
2017-12-20 14:38:13 -05:00
Santiago Pastorino
0b2db1e616
Add nll feature and make nll imply nll_dump_cause
2017-12-20 14:38:12 -05:00
Santiago Pastorino
95b6148e31
Add nll_dump_cause helper to Session
2017-12-20 14:38:12 -05:00
Niko Matsakis
508a831dca
use report_generic_bound_failure
when we can in the compiler
2017-12-20 14:38:12 -05:00
Niko Matsakis
3788f4207d
refactor report_generic_bound_failure
to be usable by NLL code
2017-12-20 14:38:12 -05:00
Niko Matsakis
6b39781df6
connect NLL machinery to the NiceRegionError
code
2017-12-20 14:38:12 -05:00
Niko Matsakis
94e7072d0b
give precedence to try_report_named_anon_conflict
method
2017-12-20 14:38:12 -05:00
Niko Matsakis
de563082c8
use Option<ErrorReported>
instead of bool
...
Also allows us to replace `or_false` with `?`.
No functional change
2017-12-20 14:38:11 -05:00
Niko Matsakis
cba4732b65
introduce a NiceRegionError
type and define methods on that
...
This is more convenient, and allows us to be more independent from
infcx, particularly with respect to `in_progress_tables` field.
No functional change.
2017-12-20 14:38:11 -05:00
Niko Matsakis
a28ab84025
nice_region_error: rustfmt
2017-12-20 14:38:11 -05:00
Niko Matsakis
3720242c75
extract find_anon_type
into its own module
2017-12-20 14:38:11 -05:00
Niko Matsakis
93498e0c22
make util
fns private to nice_region_error
2017-12-20 14:38:11 -05:00
Niko Matsakis
4089d140e0
move nice-region-error reporting into its own module
2017-12-20 14:38:11 -05:00
Niko Matsakis
e28d03f38b
only dump causes if we have nothing better
2017-12-20 14:38:11 -05:00
Santiago Pastorino
3a185a510d
Add three point error handling to borrowck
...
Closes #45988
2017-12-20 14:38:10 -05:00
Niko Matsakis
6d2987ca03
Move categorize logic out of visit_local function
2017-12-20 14:38:10 -05:00
Santiago Pastorino
58b0506d65
Move MirVisitable to visit.rs
2017-12-20 14:38:10 -05:00
Niko Matsakis
93afb1affc
connect NLL type checker to the impl trait code
...
We now add the suitable `impl Trait` constraints.
2017-12-20 14:04:52 -05:00
Niko Matsakis
da63aaa7ab
extract input_output
code into its own module
...
No functional change.
2017-12-20 14:04:52 -05:00
Niko Matsakis
a66c6512aa
pass UniversalRegions
to MIR type-checker instead of fields
...
No functional change.
2017-12-20 14:04:52 -05:00
Niko Matsakis
7f50e7ca85
extract the writeback code for anon types into InferCtxt
...
No functional change.
2017-12-20 14:04:52 -05:00
Niko Matsakis
8e64ba83be
extract constrain_anon_types
to the InferCtxt
...
No funtional change.
2017-12-20 14:04:52 -05:00
Niko Matsakis
e96f4be03d
extract instantiate_anon_types
to the InferCtxt
...
No functional change.
2017-12-20 14:04:51 -05:00
Niko Matsakis
4a967c9df7
propagate region_bound_pairs
into MIR type-check
2017-12-20 14:04:51 -05:00
Niko Matsakis
fe89f4ba86
get the DefiningTy
from the body_owner_kind
not type
...
The type isn't a good idea because we want to treat constants
uniformly, regardless of what type of value they produce.
2017-12-20 14:04:51 -05:00
Niko Matsakis
0e64a756f8
integrate -Znll-dump-cause into borrowck
2017-12-20 14:04:51 -05:00
Niko Matsakis
741ef41e41
use Rc to store nonlexical_regioncx in Borrows
2017-12-20 14:04:51 -05:00
Niko Matsakis
594c386549
dump out causal information for "free region" errors
...
The result is not especially illuminating, but that's ok.
2017-12-20 14:04:51 -05:00
Niko Matsakis
39b0e49ebd
rustfmt: borrow_check/mod.rs
2017-12-20 14:04:51 -05:00
Paul Daniel Faria
e447b54bc3
Add tracking of causes for nll
2017-12-20 14:04:50 -05:00
Niko Matsakis
f6741d0a7a
region_infer/values.rs: rustfmt
2017-12-20 14:04:50 -05:00
Niko Matsakis
f3335c6169
simplify AnonTypeDecl
in the impl trait code
...
We don't need to know the vector of region bounds; we only care if
there were any region bounds at all.
2017-12-20 14:04:50 -05:00
Esteban Küber
eed98d55fb
Various tweaks
2017-12-20 11:03:26 -08:00
bors
7eb64b86ce
Auto merge of #46583 - scottmcm:fix-static-i128-lower, r=eddyb
...
Fix -Z lower_128bit_ops handling of statics
Avoids ICEs such as the following:
> error: internal compiler error: src\librustc_metadata\cstore_impl.rs:131:
> get_optimized_mir: missing MIR for `DefId(8/0:40 ~
> compiler_builtins[9532]::int[0]::addsub[0]::rust_i128_addo[0])`
r? @nagisa
cc #45676 @est31
2017-12-20 17:34:17 +00:00
Felix S. Klock II
a0e1d509ab
Ensure separate activations only occur for assignments to locals, not projections.
...
Fix #46746 .
2017-12-20 18:15:33 +01:00
Guillaume Gomez
8835289434
Fix some rustdoc warnings
2017-12-20 17:50:02 +01:00
Manish Goregaokar
52c28fffa9
Clarify vec docs on deallocation ( fixes #46879 )
2017-12-20 08:29:32 -08:00
Michael Woerister
44a0522b18
incr.comp.: Use ensure() for some coherence-related queries.
2017-12-20 16:45:23 +01:00
Michael Woerister
dba52ced4c
incr.comp.: Cache check_match query.
2017-12-20 16:38:27 +01:00
Michael Woerister
8ac65af81f
Implement Encodable and Decodable for Result.
2017-12-20 16:37:29 +01:00
bors
81622c6b02
Auto merge of #46874 - kennytm:rollup, r=kennytm
...
Rollup of 14 pull requests
- Successful merges: #46359 , #46517 , #46671 , #46751 , #46760 , #46787 , #46794 , #46828 , #46831 , #46835 , #46851 , #46852 , #46856 , #46870
- Failed merges:
2017-12-20 14:47:21 +00:00
Marco A L Barbosa
1470e77426
Update compiler_builtins
...
Fixes https://github.com/rust-lang/rust/issues/46822
(https://github.com/rust-lang-nursery/compiler-builtins/pull/218 )
2017-12-20 11:46:15 -02:00