From 4e3db5e0f48f5dcebd34a5a5be1a10c6d9a8f706 Mon Sep 17 00:00:00 2001 From: Ahmed Charles Date: Mon, 26 May 2014 17:55:54 -0700 Subject: Rename PatUniq to PatBox. Fixes part of #13910. --- src/libsyntax/ast.rs | 2 +- src/libsyntax/ast_util.rs | 2 +- src/libsyntax/fold.rs | 2 +- src/libsyntax/parse/parser.rs | 6 +++--- src/libsyntax/print/pprust.rs | 2 +- src/libsyntax/visit.rs | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 69a92a87185..9ddfd9bc637 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -347,7 +347,7 @@ pub enum Pat_ { * we don't bind the fields to names */ PatStruct(Path, Vec , bool), PatTup(Vec<@Pat> ), - PatUniq(@Pat), + PatBox(@Pat), PatRegion(@Pat), // reference pattern PatLit(@Expr), PatRange(@Expr, @Expr), diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs index 3e41e58fbe2..3dd16944a84 100644 --- a/src/libsyntax/ast_util.rs +++ b/src/libsyntax/ast_util.rs @@ -657,7 +657,7 @@ pub fn walk_pat(pat: &Pat, it: |&Pat| -> bool) -> bool { PatEnum(_, Some(ref s)) | PatTup(ref s) => { s.iter().advance(|&p| walk_pat(p, |p| it(p))) } - PatUniq(s) | PatRegion(s) => { + PatBox(s) | PatRegion(s) => { walk_pat(s, it) } PatVec(ref before, ref slice, ref after) => { diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs index 1607820326b..011e2e536f2 100644 --- a/src/libsyntax/fold.rs +++ b/src/libsyntax/fold.rs @@ -760,7 +760,7 @@ pub fn noop_fold_pat(p: @Pat, folder: &mut T) -> @Pat { PatStruct(pth_, fs, etc) } PatTup(ref elts) => PatTup(elts.iter().map(|x| folder.fold_pat(*x)).collect()), - PatUniq(inner) => PatUniq(folder.fold_pat(inner)), + PatBox(inner) => PatBox(folder.fold_pat(inner)), PatRegion(inner) => PatRegion(folder.fold_pat(inner)), PatRange(e1, e2) => { PatRange(folder.fold_expr(e1), folder.fold_expr(e2)) diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 6832555f728..a43e88d6d65 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -39,7 +39,7 @@ use ast::{MutImmutable, MutMutable, Mac_, MacInvocTT, Matcher, MatchNonterminal} use ast::{MatchSeq, MatchTok, Method, MutTy, BiMul, Mutability}; use ast::{NamedField, UnNeg, NoReturn, UnNot, P, Pat, PatEnum}; use ast::{PatIdent, PatLit, PatRange, PatRegion, PatStruct}; -use ast::{PatTup, PatUniq, PatWild, PatWildMulti}; +use ast::{PatTup, PatBox, PatWild, PatWildMulti}; use ast::{BiRem, Required}; use ast::{RetStyle, Return, BiShl, BiShr, Stmt, StmtDecl}; use ast::{Sized, DynSize, StaticSize}; @@ -2784,7 +2784,7 @@ impl<'a> Parser<'a> { // parse ~pat self.bump(); let sub = self.parse_pat(); - pat = PatUniq(sub); + pat = PatBox(sub); hi = self.last_span.hi; self.obsolete(self.last_span, ObsoleteOwnedPattern); return @ast::Pat { @@ -2888,7 +2888,7 @@ impl<'a> Parser<'a> { // FIXME(#13910): Rename to `PatBox` and extend to full DST // support. let sub = self.parse_pat(); - pat = PatUniq(sub); + pat = PatBox(sub); hi = self.last_span.hi; return @ast::Pat { id: ast::DUMMY_NODE_ID, diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 3cb2d0b421c..31c2ef9a8d1 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -1721,7 +1721,7 @@ impl<'a> State<'a> { } try!(self.pclose()); } - ast::PatUniq(inner) => { + ast::PatBox(inner) => { try!(word(&mut self.s, "box ")); try!(self.print_pat(inner)); } diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs index ce10d0db3ba..d17eba18643 100644 --- a/src/libsyntax/visit.rs +++ b/src/libsyntax/visit.rs @@ -429,7 +429,7 @@ pub fn walk_pat>(visitor: &mut V, pattern: &Pat, env: E) visitor.visit_pat(*tuple_element, env.clone()) } } - PatUniq(subpattern) | + PatBox(subpattern) | PatRegion(subpattern) => { visitor.visit_pat(subpattern, env) } -- cgit 1.4.1-3-g733a5