summary refs log tree commit diff
path: root/src/libsyntax/ast_map
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-11-20 12:01:44 +0000
committerbors <bors@rust-lang.org>2014-11-20 12:01:44 +0000
commit1d81776209cfa2b5cb1825bdbf3965a7a7f0440a (patch)
tree43c3aa55ebfb5fd8b24173e1315a4212346bbd8f /src/libsyntax/ast_map
parentb825b3496aff1ed784f7a7ca935245208b95aabb (diff)
parentb9c5cd4dc420b90874784b253bcb8fd4ac72441a (diff)
downloadrust-1d81776209cfa2b5cb1825bdbf3965a7a7f0440a.tar.gz
rust-1d81776209cfa2b5cb1825bdbf3965a7a7f0440a.zip
auto merge of #19113 : nikomatsakis/rust/unboxed-boxed-closure-unification, r=acrichto
Use the expected type to infer the argument/return types of unboxed closures. Also, in `||` expressions, use the expected type to decide if the result should be a boxed or unboxed closure (and if an unboxed closure, what kind).

This supercedes PR #19089, which was already reviewed by @pcwalton.
Diffstat (limited to 'src/libsyntax/ast_map')
-rw-r--r--src/libsyntax/ast_map/blocks.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsyntax/ast_map/blocks.rs b/src/libsyntax/ast_map/blocks.rs
index a35ee3ab1d0..8db12fbd835 100644
--- a/src/libsyntax/ast_map/blocks.rs
+++ b/src/libsyntax/ast_map/blocks.rs
@@ -37,7 +37,7 @@ use visit;
 ///
 /// More specifically, it is one of either:
 ///   - A function item,
-///   - A closure expr (i.e. an ExprFnBlock or ExprProc), or
+///   - A closure expr (i.e. an ExprClosure or ExprProc), or
 ///   - The default implementation for a trait method.
 ///
 /// To construct one, use the `Code::from_node` function.
@@ -71,7 +71,7 @@ impl MaybeFnLike for ast::TraitItem {
 impl MaybeFnLike for ast::Expr {
     fn is_fn_like(&self) -> bool {
         match self.node {
-            ast::ExprFnBlock(..) | ast::ExprProc(..) => true,
+            ast::ExprClosure(..) | ast::ExprProc(..) => true,
             _ => false,
         }
     }
@@ -215,7 +215,7 @@ impl<'a> FnLikeNode<'a> {
                 }
             }
             ast_map::NodeExpr(e) => match e.node {
-                ast::ExprFnBlock(_, ref decl, ref block) =>
+                ast::ExprClosure(_, _, ref decl, ref block) =>
                     closure(ClosureParts::new(&**decl, &**block, e.id, e.span)),
                 ast::ExprProc(ref decl, ref block) =>
                     closure(ClosureParts::new(&**decl, &**block, e.id, e.span)),