Skip to content

Commit 86b5060

Browse files
committed
---
yaml --- r: 274759 b: refs/heads/stable c: 8516ba3 h: refs/heads/master i: 274757: 6b32f9c 274755: c14e791 274751: c764d87
1 parent fbdd00e commit 86b5060

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: c0221c8897db309a79990367476177b1230bb264
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 243a30c9319b56e1be2b9ff2f9ed9e0d7583e2d1
32+
refs/heads/stable: 8516ba367d1f51318ce373fe9b60650c82ded1e9
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/src/librustc_front/lowering.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,10 +1555,10 @@ pub fn lower_stmt(lctx: &LoweringContext, s: &Stmt) -> hir::Stmt {
15551555
}
15561556
}
15571557

1558-
pub fn lower_capture_clause(_lctx: &LoweringContext, c: CaptureClause) -> hir::CaptureClause {
1558+
pub fn lower_capture_clause(_lctx: &LoweringContext, c: CaptureBy) -> hir::CaptureClause {
15591559
match c {
1560-
CaptureByValue => hir::CaptureByValue,
1561-
CaptureByRef => hir::CaptureByRef,
1560+
CaptureBy::Value => hir::CaptureByValue,
1561+
CaptureBy::Ref => hir::CaptureByRef,
15621562
}
15631563
}
15641564

branches/stable/src/libsyntax/ast.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
// The Rust abstract syntax tree.
1212

13-
pub use self::CaptureClause::*;
1413
pub use self::Decl_::*;
1514
pub use self::ExplicitSelf_::*;
1615
pub use self::Expr_::*;
@@ -973,7 +972,7 @@ pub enum Expr_ {
973972
/// A `match` block.
974973
ExprMatch(P<Expr>, Vec<Arm>),
975974
/// A closure (for example, `move |a, b, c| {a + b + c}`)
976-
ExprClosure(CaptureClause, P<FnDecl>, P<Block>),
975+
ExprClosure(CaptureBy, P<FnDecl>, P<Block>),
977976
/// A block (`{ ... }`)
978977
ExprBlock(P<Block>),
979978

@@ -1052,10 +1051,11 @@ pub struct QSelf {
10521051
pub position: usize
10531052
}
10541053

1054+
/// A capture clause
10551055
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)]
1056-
pub enum CaptureClause {
1057-
CaptureByValue,
1058-
CaptureByRef,
1056+
pub enum CaptureBy {
1057+
Value,
1058+
Ref,
10591059
}
10601060

10611061
/// A delimited sequence of token trees

branches/stable/src/libsyntax/ext/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -883,14 +883,14 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
883883

884884
fn lambda_fn_decl(&self, span: Span,
885885
fn_decl: P<ast::FnDecl>, blk: P<ast::Block>) -> P<ast::Expr> {
886-
self.expr(span, ast::ExprClosure(ast::CaptureByRef, fn_decl, blk))
886+
self.expr(span, ast::ExprClosure(ast::CaptureBy::Ref, fn_decl, blk))
887887
}
888888
fn lambda(&self, span: Span, ids: Vec<ast::Ident>, blk: P<ast::Block>) -> P<ast::Expr> {
889889
let fn_decl = self.fn_decl(
890890
ids.iter().map(|id| self.arg(span, *id, self.ty_infer(span))).collect(),
891891
self.ty_infer(span));
892892

893-
self.expr(span, ast::ExprClosure(ast::CaptureByRef, fn_decl, blk))
893+
self.expr(span, ast::ExprClosure(ast::CaptureBy::Ref, fn_decl, blk))
894894
}
895895
fn lambda0(&self, span: Span, blk: P<ast::Block>) -> P<ast::Expr> {
896896
self.lambda(span, Vec::new(), blk)

branches/stable/src/libsyntax/parse/parser.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use ast::{RegionTyParamBound, TraitTyParamBound, TraitBoundModifier};
1616
use ast::{Public, Unsafety};
1717
use ast::{Mod, Arg, Arm, Attribute, BindingMode};
1818
use ast::Block;
19-
use ast::{BlockCheckMode, CaptureByRef, CaptureByValue, CaptureClause};
19+
use ast::{BlockCheckMode, CaptureBy};
2020
use ast::{Constness, ConstTraitItem, Crate, CrateConfig};
2121
use ast::{Decl, DeclItem, DeclLocal};
2222
use ast::{EMPTY_CTXT, EnumDef, ExplicitSelf};
@@ -2108,7 +2108,7 @@ impl<'a> Parser<'a> {
21082108
},
21092109
token::BinOp(token::Or) | token::OrOr => {
21102110
let lo = self.span.lo;
2111-
return self.parse_lambda_expr(lo, CaptureByRef, attrs);
2111+
return self.parse_lambda_expr(lo, CaptureBy::Ref, attrs);
21122112
},
21132113
token::Ident(id @ ast::Ident {
21142114
name: token::SELF_KEYWORD_NAME,
@@ -2167,7 +2167,7 @@ impl<'a> Parser<'a> {
21672167
}
21682168
if self.eat_keyword(keywords::Move) {
21692169
let lo = self.last_span.lo;
2170-
return self.parse_lambda_expr(lo, CaptureByValue, attrs);
2170+
return self.parse_lambda_expr(lo, CaptureBy::Value, attrs);
21712171
}
21722172
if self.eat_keyword(keywords::If) {
21732173
return self.parse_if_expr(attrs);
@@ -3047,7 +3047,7 @@ impl<'a> Parser<'a> {
30473047

30483048
// `|args| expr`
30493049
pub fn parse_lambda_expr(&mut self, lo: BytePos,
3050-
capture_clause: CaptureClause,
3050+
capture_clause: CaptureBy,
30513051
attrs: ThinAttributes)
30523052
-> PResult<'a, P<Expr>>
30533053
{

branches/stable/src/libsyntax/print/pprust.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2741,11 +2741,11 @@ impl<'a> State<'a> {
27412741
}
27422742
}
27432743

2744-
pub fn print_capture_clause(&mut self, capture_clause: ast::CaptureClause)
2744+
pub fn print_capture_clause(&mut self, capture_clause: ast::CaptureBy)
27452745
-> io::Result<()> {
27462746
match capture_clause {
2747-
ast::CaptureByValue => self.word_space("move"),
2748-
ast::CaptureByRef => Ok(()),
2747+
ast::CaptureBy::Value => self.word_space("move"),
2748+
ast::CaptureBy::Ref => Ok(()),
27492749
}
27502750
}
27512751

0 commit comments

Comments
 (0)