rust/src/test
Alex Crichton 74f7e06939 rollup merge of #21899: nikomatsakis/closure-unify-anyhow
This *almost* completes the job for #16440. The idea is that even if we do not know whether some closure type `C` implements `Fn` or `FnMut` (etc), we still know its argument and return types. So if we see an obligation `C : Fn(_0)`, we can unify `_0` with those argument types while still considering the obligation ambiguous and unsatisfied. This helps to make a lot of progress with type inference even before closure kind inference is done.

As part of this PR, the explicit `:` syntax is removed from the AST and completely ignored. We still infer the closure kind based on the expected type if that is available. There are several reasons for this. First, deciding the closure kind earlier is always better, as it allows us to make more progress. Second, this retains a (admittedly obscure) way for users to manually specify the closure kind, which is useful for writing tests if nothing else. Finally, there are still some cases where inference can fail, so it may be useful to have this manual override. (The expectation is that we will eventually revisit an explicit syntax for specifying the closure kind, but it will not be `:` and may be some sort of generalization of the `||` syntax to handle other traits as well.)

This commit does not *quite* fix #16640 because a snapshot is still needed to enable the obsolete syntax errors for explicit `&mut:` and friends.

r? @eddyb as he reviewed the prior patch in this direction
2015-02-03 20:11:20 -08:00
..
auxiliary Auto merge of #21675 - huonw:less-false-positives, r=nikomatsakis 2015-02-03 12:49:21 +00:00
bench rollup merge of #21830: japaric/for-cleanup 2015-02-02 11:01:12 -08:00
codegen
compile-fail rollup merge of #21899: nikomatsakis/closure-unify-anyhow 2015-02-03 20:11:20 -08:00
compile-fail-fulldeps
debuginfo Rename std::path to std::old_path 2015-02-03 14:34:42 -08:00
pretty for x in xs.iter() -> for x in &xs 2015-02-02 13:40:18 -05:00
run-fail
run-make Test fixes and rebase conflicts 2015-02-02 18:50:23 -08:00
run-pass rollup merge of #21899: nikomatsakis/closure-unify-anyhow 2015-02-03 20:11:20 -08:00
run-pass-fulldeps
run-pass-valgrind