diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2012-12-07 19:34:57 -0800 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2012-12-07 19:34:57 -0800 |
| commit | 98fdcb0b9d8b66a5feef1e45c06aeec93919d254 (patch) | |
| tree | d1d01fe8cf77c4be5a2331b606a2de7774e380a4 /src/libsyntax | |
| parent | 184f5102b37c9a52342382fe9e88144a62cd9782 (diff) | |
| download | rust-98fdcb0b9d8b66a5feef1e45c06aeec93919d254.tar.gz rust-98fdcb0b9d8b66a5feef1e45c06aeec93919d254.zip | |
librustc: De-mode pattern bindings. r=nmatsakis
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast.rs | 8 | ||||
| -rw-r--r-- | src/libsyntax/ext/pipes/ast_builder.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 10 | ||||
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 2 |
4 files changed, 9 insertions, 13 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index da80bd489b5..aeb76037535 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -309,7 +309,7 @@ enum binding_mode { bind_by_value, bind_by_move, bind_by_ref(ast::mutability), - bind_by_implicit_ref + bind_infer } impl binding_mode : to_bytes::IterBytes { @@ -322,7 +322,7 @@ impl binding_mode : to_bytes::IterBytes { bind_by_ref(ref m) => to_bytes::iter_bytes_2(&2u8, m, lsb0, f), - bind_by_implicit_ref => + bind_infer => 3u8.iter_bytes(lsb0, f), } } @@ -349,9 +349,9 @@ impl binding_mode : cmp::Eq { _ => false } } - bind_by_implicit_ref => { + bind_infer => { match (*other) { - bind_by_implicit_ref => true, + bind_infer => true, _ => false } } diff --git a/src/libsyntax/ext/pipes/ast_builder.rs b/src/libsyntax/ext/pipes/ast_builder.rs index 7e5a267c008..66d9e44ba2e 100644 --- a/src/libsyntax/ext/pipes/ast_builder.rs +++ b/src/libsyntax/ext/pipes/ast_builder.rs @@ -134,7 +134,7 @@ impl ext_ctxt: ext_ctxt_ast_builder { @{node: {is_mutbl: false, ty: self.ty_infer(), pat: @{id: self.next_id(), - node: ast::pat_ident(ast::bind_by_implicit_ref, + node: ast::pat_ident(ast::bind_infer, path(~[ident], dummy_sp()), None), diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 8e354f7017d..1bd3f970573 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -23,7 +23,7 @@ use obsolete::{ ObsoleteModeInFnType, ObsoleteMoveInit, ObsoleteBinaryMove, }; use ast::{_mod, add, arg, arm, attribute, - bind_by_ref, bind_by_implicit_ref, bind_by_value, bind_by_move, + bind_by_ref, bind_infer, bind_by_value, bind_by_move, bitand, bitor, bitxor, blk, blk_check_mode, box, by_copy, by_move, by_ref, by_val, capture_clause, capture_item, class_immutable, class_mutable, @@ -1925,9 +1925,7 @@ impl Parser { } else { subpat = @{ id: self.get_id(), - node: pat_ident(bind_by_implicit_ref, - fieldpath, - None), + node: pat_ident(bind_infer, fieldpath, None), span: self.last_span }; } @@ -2054,9 +2052,7 @@ impl Parser { } else if self.eat_keyword(~"move") { binding_mode = bind_by_move; } else if refutable { - // XXX: Should be bind_by_value, but that's not - // backward compatible. - binding_mode = bind_by_implicit_ref; + binding_mode = bind_infer; } else { binding_mode = bind_by_value; } diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 5b0663f0b44..d9642e08475 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -1573,7 +1573,7 @@ fn print_pat(s: ps, &&pat: @ast::pat, refutable: bool) { ast::bind_by_value => { word_nbsp(s, ~"copy"); } - ast::bind_by_implicit_ref => {} + ast::bind_infer => {} } } print_path(s, path, true); |
