Skip to content

Commit 6dbf37e

Browse files
committed
---
yaml --- r: 162413 b: refs/heads/try c: 394269d h: refs/heads/master i: 162411: aec4011 v: v3
1 parent eed029d commit 6dbf37e

35 files changed

+596
-345
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 9146a919b616e39e528e4d7100d16eef52f1f852
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cafe2966770ff377aad6dd9fd808e68055587c58
5-
refs/heads/try: 5ff9087e05e6661990856ab3bdbc197e50380db5
5+
refs/heads/try: 394269d16e3752a23ffa273e68f8aaefd2a510c4
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/librustc/middle/borrowck/mod.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,12 @@ pub fn closure_to_block(closure_id: ast::NodeId,
300300
match tcx.map.get(closure_id) {
301301
ast_map::NodeExpr(expr) => match expr.node {
302302
ast::ExprProc(_, ref block) |
303-
ast::ExprFnBlock(_, _, ref block) |
304-
ast::ExprUnboxedFn(_, _, _, ref block) => { block.id }
305-
_ => panic!("encountered non-closure id: {}", closure_id)
303+
ast::ExprClosure(_, _, _, ref block) => {
304+
block.id
305+
}
306+
_ => {
307+
panic!("encountered non-closure id: {}", closure_id)
308+
}
306309
},
307310
_ => panic!("encountered non-expr id: {}", closure_id)
308311
}

branches/try/src/librustc/middle/cfg/construct.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,9 +497,8 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
497497
}
498498

499499
ast::ExprMac(..) |
500-
ast::ExprFnBlock(..) |
500+
ast::ExprClosure(..) |
501501
ast::ExprProc(..) |
502-
ast::ExprUnboxedFn(..) |
503502
ast::ExprLit(..) |
504503
ast::ExprPath(..) => {
505504
self.straightline(expr, pred, None::<ast::Expr>.iter())

branches/try/src/librustc/middle/check_loop.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,8 @@ impl<'a, 'v> Visitor<'v> for CheckLoopVisitor<'a> {
4848
self.visit_expr(&**e);
4949
self.with_context(Loop, |v| v.visit_block(&**b));
5050
}
51-
ast::ExprFnBlock(_, _, ref b) |
52-
ast::ExprProc(_, ref b) |
53-
ast::ExprUnboxedFn(_, _, _, ref b) => {
51+
ast::ExprClosure(_, _, _, ref b) |
52+
ast::ExprProc(_, ref b) => {
5453
self.with_context(Closure, |v| v.visit_block(&**b));
5554
}
5655
ast::ExprBreak(_) => self.require_loop("break", e.span),

branches/try/src/librustc/middle/expr_use_visitor.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,8 +499,7 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,'tcx,TYPER> {
499499
self.consume_expr(&**count);
500500
}
501501

502-
ast::ExprFnBlock(..) |
503-
ast::ExprUnboxedFn(..) |
502+
ast::ExprClosure(..) |
504503
ast::ExprProc(..) => {
505504
self.walk_captures(expr)
506505
}

branches/try/src/librustc/middle/liveness.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ fn visit_expr(ir: &mut IrMaps, expr: &Expr) {
458458
}
459459
visit::walk_expr(ir, expr);
460460
}
461-
ast::ExprFnBlock(..) | ast::ExprProc(..) | ast::ExprUnboxedFn(..) => {
461+
ast::ExprClosure(..) | ast::ExprProc(..) => {
462462
// Interesting control flow (for loops can contain labeled
463463
// breaks or continues)
464464
ir.add_live_node_for_node(expr.id, ExprNode(expr.span));
@@ -975,10 +975,9 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
975975
self.propagate_through_expr(&**e, succ)
976976
}
977977

978-
ast::ExprFnBlock(_, _, ref blk) |
979-
ast::ExprProc(_, ref blk) |
980-
ast::ExprUnboxedFn(_, _, _, ref blk) => {
981-
debug!("{} is an ExprFnBlock, ExprProc, or ExprUnboxedFn",
978+
ast::ExprClosure(_, _, _, ref blk) |
979+
ast::ExprProc(_, ref blk) => {
980+
debug!("{} is an ExprClosure or ExprProc",
982981
expr_to_string(expr));
983982

984983
/*
@@ -1495,7 +1494,7 @@ fn check_expr(this: &mut Liveness, expr: &Expr) {
14951494
ast::ExprBreak(..) | ast::ExprAgain(..) | ast::ExprLit(_) |
14961495
ast::ExprBlock(..) | ast::ExprMac(..) | ast::ExprAddrOf(..) |
14971496
ast::ExprStruct(..) | ast::ExprRepeat(..) | ast::ExprParen(..) |
1498-
ast::ExprFnBlock(..) | ast::ExprProc(..) | ast::ExprUnboxedFn(..) |
1497+
ast::ExprClosure(..) | ast::ExprProc(..) |
14991498
ast::ExprPath(..) | ast::ExprBox(..) | ast::ExprSlice(..) => {
15001499
visit::walk_expr(this, expr);
15011500
}

branches/try/src/librustc/middle/mem_categorization.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -521,8 +521,8 @@ impl<'t,'tcx,TYPER:Typer<'tcx>> MemCategorizationContext<'t,TYPER> {
521521

522522
ast::ExprAddrOf(..) | ast::ExprCall(..) |
523523
ast::ExprAssign(..) | ast::ExprAssignOp(..) |
524-
ast::ExprFnBlock(..) | ast::ExprProc(..) |
525-
ast::ExprUnboxedFn(..) | ast::ExprRet(..) |
524+
ast::ExprClosure(..) | ast::ExprProc(..) |
525+
ast::ExprRet(..) |
526526
ast::ExprUnary(..) | ast::ExprSlice(..) |
527527
ast::ExprMethodCall(..) | ast::ExprCast(..) |
528528
ast::ExprVec(..) | ast::ExprTup(..) | ast::ExprIf(..) |
@@ -694,9 +694,8 @@ impl<'t,'tcx,TYPER:Typer<'tcx>> MemCategorizationContext<'t,TYPER> {
694694
};
695695

696696
match fn_expr.node {
697-
ast::ExprFnBlock(_, _, ref body) |
698697
ast::ExprProc(_, ref body) |
699-
ast::ExprUnboxedFn(_, _, _, ref body) => body.id,
698+
ast::ExprClosure(_, _, _, ref body) => body.id,
700699
_ => unreachable!()
701700
}
702701
};

branches/try/src/librustc/middle/resolve.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ use util::nodemap::{NodeMap, NodeSet, DefIdSet, FnvHashMap};
5050

5151
use syntax::ast::{Arm, BindByRef, BindByValue, BindingMode, Block, Crate, CrateNum};
5252
use syntax::ast::{DeclItem, DefId, Expr, ExprAgain, ExprBreak, ExprField};
53-
use syntax::ast::{ExprFnBlock, ExprForLoop, ExprLoop, ExprWhile, ExprMethodCall};
54-
use syntax::ast::{ExprPath, ExprProc, ExprStruct, ExprUnboxedFn, FnDecl};
53+
use syntax::ast::{ExprClosure, ExprForLoop, ExprLoop, ExprWhile, ExprMethodCall};
54+
use syntax::ast::{ExprPath, ExprProc, ExprStruct, FnDecl};
5555
use syntax::ast::{ForeignItem, ForeignItemFn, ForeignItemStatic, Generics};
5656
use syntax::ast::{Ident, ImplItem, Item, ItemEnum, ItemFn, ItemForeignMod};
5757
use syntax::ast::{ItemImpl, ItemMac, ItemMod, ItemStatic, ItemStruct};
@@ -5848,24 +5848,19 @@ impl<'a> Resolver<'a> {
58485848
visit::walk_expr(self, expr);
58495849
}
58505850

5851-
ExprFnBlock(capture_clause, ref fn_decl, ref block) => {
5851+
ExprClosure(capture_clause, _, ref fn_decl, ref block) => {
58525852
self.capture_mode_map.insert(expr.id, capture_clause);
58535853
self.resolve_function(ClosureRibKind(expr.id, ast::DUMMY_NODE_ID),
58545854
Some(&**fn_decl), NoTypeParameters,
58555855
&**block);
58565856
}
5857+
58575858
ExprProc(ref fn_decl, ref block) => {
58585859
self.capture_mode_map.insert(expr.id, ast::CaptureByValue);
58595860
self.resolve_function(ClosureRibKind(expr.id, block.id),
58605861
Some(&**fn_decl), NoTypeParameters,
58615862
&**block);
58625863
}
5863-
ExprUnboxedFn(capture_clause, _, ref fn_decl, ref block) => {
5864-
self.capture_mode_map.insert(expr.id, capture_clause);
5865-
self.resolve_function(ClosureRibKind(expr.id, block.id),
5866-
Some(&**fn_decl), NoTypeParameters,
5867-
&**block);
5868-
}
58695864

58705865
ExprStruct(ref path, _, _) => {
58715866
// Resolve the path to the structure it goes to. We don't

branches/try/src/librustc/middle/traits/fulfill.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ impl<'tcx> FulfillmentContext<'tcx> {
109109
self.select(&mut selcx, false)
110110
}
111111

112+
pub fn pending_trait_obligations(&self) -> &[Obligation<'tcx>] {
113+
self.trait_obligations[]
114+
}
115+
112116
fn select<'a>(&mut self,
113117
selcx: &mut SelectionContext<'a, 'tcx>,
114118
only_new_obligations: bool)

branches/try/src/librustc/middle/ty.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3922,9 +3922,8 @@ pub fn expr_kind(tcx: &ctxt, expr: &ast::Expr) -> ExprKind {
39223922
ast::ExprTup(..) |
39233923
ast::ExprIf(..) |
39243924
ast::ExprMatch(..) |
3925-
ast::ExprFnBlock(..) |
3925+
ast::ExprClosure(..) |
39263926
ast::ExprProc(..) |
3927-
ast::ExprUnboxedFn(..) |
39283927
ast::ExprBlock(..) |
39293928
ast::ExprRepeat(..) |
39303929
ast::ExprVec(..) => {

branches/try/src/librustc/middle/typeck/astconv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,7 @@ pub fn ast_ty_to_ty<'tcx, AC: AstConv<'tcx>, RS: RegionScope>(
995995
}
996996
ast::TyInfer => {
997997
// TyInfer also appears as the type of arguments or return
998-
// values in a ExprFnBlock, ExprProc, or ExprUnboxedFn, or as
998+
// values in a ExprClosure or ExprProc, or as
999999
// the type of local variables. Both of these cases are
10001000
// handled specially and will not descend into this routine.
10011001
this.ty_infer(ast_ty.span)

0 commit comments

Comments
 (0)