]> git.lizzy.rs Git - rust.git/commitdiff
Rename PatUniq to PatBox. Fixes part of #13910.
authorAhmed Charles <ahmedcharles@gmail.com>
Tue, 27 May 2014 00:55:54 +0000 (17:55 -0700)
committerAhmed Charles <ahmedcharles@gmail.com>
Wed, 28 May 2014 05:19:29 +0000 (22:19 -0700)
14 files changed:
src/librustc/middle/cfg/construct.rs
src/librustc/middle/check_match.rs
src/librustc/middle/mem_categorization.rs
src/librustc/middle/region.rs
src/librustc/middle/trans/_match.rs
src/librustc/middle/trans/debuginfo.rs
src/librustc/middle/typeck/check/_match.rs
src/librustdoc/clean/mod.rs
src/libsyntax/ast.rs
src/libsyntax/ast_util.rs
src/libsyntax/fold.rs
src/libsyntax/parse/parser.rs
src/libsyntax/print/pprust.rs
src/libsyntax/visit.rs

index acf2442f6c16bd33168f53775dad97edad0e3bed..b1b8ab626f6c096473dc66ac79cd64f14933fd65 100644 (file)
@@ -113,7 +113,7 @@ fn pat(&mut self, pat: @ast::Pat, pred: CFGIndex) -> CFGIndex {
                 self.add_node(pat.id, [pred])
             }
 
-            ast::PatUniq(subpat) |
+            ast::PatBox(subpat) |
             ast::PatRegion(subpat) |
             ast::PatIdent(_, _, Some(subpat)) => {
                 let subpat_exit = self.pat(subpat, pred);
index ffc9ee7ec767a770a4e7bbc33238d273d73d8b01..32cb5c4629975d5a0a216b5f5839458428c67f16 100644 (file)
@@ -383,7 +383,7 @@ fn pat_ctor_id(cx: &MatchCheckCtxt, p: @Pat) -> Option<ctor> {
           _ => Some(single)
         }
       }
-      PatUniq(_) | PatTup(_) | PatRegion(..) => {
+      PatBox(_) | PatTup(_) | PatRegion(..) => {
         Some(single)
       }
       PatVec(ref before, slice, ref after) => {
@@ -763,7 +763,7 @@ fn specialize(cx: &MatchCheckCtxt,
             PatTup(args) => {
                 Some(args.iter().map(|x| *x).collect::<Vec<_>>().append(r.tail()))
             }
-            PatUniq(a) | PatRegion(a) => {
+            PatBox(a) | PatRegion(a) => {
                 Some((vec!(a)).append(r.tail()))
             }
             PatLit(expr) => {
@@ -919,7 +919,7 @@ macro_rules! this_pattern {
     }
 
     match pat.node {
-      PatUniq(sub) | PatRegion(sub) | PatIdent(_, _, Some(sub)) => {
+      PatBox(sub) | PatRegion(sub) | PatIdent(_, _, Some(sub)) => {
         find_refutable(cx, sub, spans)
       }
       PatWild | PatWildMulti | PatIdent(_, _, None) => {}
index 5787657d6396fa58463e7dceb0097a20c479d5a1..e12b4b76138ffc2926b51f0bdb633b099329a7a1 100644 (file)
@@ -1064,7 +1064,7 @@ pub fn cat_pattern(&self,
             }
           }
 
-          ast::PatUniq(subpat) | ast::PatRegion(subpat) => {
+          ast::PatBox(subpat) | ast::PatRegion(subpat) => {
             // @p1, ~p1
             let subcmt = self.cat_deref(pat, cmt, 0);
             if_ok!(self.cat_pattern(subcmt, subpat, op));
index 6f42769891ea5131d3cdf329ee8e3e85e8243f71..802f2d5ccab76ccc91f568db97dd51c9acea5ef6 100644 (file)
@@ -671,7 +671,7 @@ fn is_binding_pat(pat: &ast::Pat) -> bool {
                 subpats.iter().any(|&p| is_binding_pat(p))
             }
 
-            ast::PatUniq(subpat) => {
+            ast::PatBox(subpat) => {
                 is_binding_pat(subpat)
             }
 
index a10b31e923b196c4652fb827d95cdfaf3b46270b..7c14eb247c32021f37207580b50315a753a8b4ec 100644 (file)
@@ -838,7 +838,7 @@ fn enter_uniq<'a, 'b>(
     let dummy = @ast::Pat {id: 0, node: ast::PatWild, span: DUMMY_SP};
     enter_match(bcx, dm, m, col, val, |p| {
         match p.node {
-            ast::PatUniq(sub) => {
+            ast::PatBox(sub) => {
                 Some(vec!(sub))
             }
             _ => {
@@ -1105,7 +1105,7 @@ macro_rules! any_pat (
 )
 
 fn any_uniq_pat(m: &[Match], col: uint) -> bool {
-    any_pat!(m, ast::PatUniq(_))
+    any_pat!(m, ast::PatBox(_))
 }
 
 fn any_region_pat(m: &[Match], col: uint) -> bool {
@@ -2270,7 +2270,7 @@ fn bind_irrefutable_pat<'a>(
                                            binding_mode, cleanup_scope);
             }
         }
-        ast::PatUniq(inner) => {
+        ast::PatBox(inner) => {
             let llbox = Load(bcx, val);
             bcx = bind_irrefutable_pat(bcx, inner, llbox, binding_mode, cleanup_scope);
         }
index 225c3c48cf406786e7c82ead502692a85184b3a1..c9759d0979c57bdaa4ef1d5faa2c12b617a0dcc7 100644 (file)
@@ -2633,7 +2633,7 @@ fn walk_pattern(cx: &CrateContext,
                 }
             }
 
-            ast::PatUniq(sub_pat) | ast::PatRegion(sub_pat) => {
+            ast::PatBox(sub_pat) | ast::PatRegion(sub_pat) => {
                 scope_map.insert(pat.id, scope_stack.last().unwrap().scope_metadata);
                 walk_pattern(cx, sub_pat, scope_stack, scope_map);
             }
index 3d37de38e4523eba450b9ddc34a62703cf524a9e..ef2bee728d4818da1560d9d551fbadbef199db02 100644 (file)
@@ -634,7 +634,7 @@ pub fn check_pat(pcx: &pat_ctxt, pat: &ast::Pat, expected: ty::t) {
             }
         }
       }
-      ast::PatUniq(inner) => {
+      ast::PatBox(inner) => {
           check_pointer_pat(pcx, Send, inner, pat.id, pat.span, expected);
       }
       ast::PatRegion(inner) => {
index 33e3e5370e69ed8928b99866709d4eab0531c7e2..1cec5f20b2c735f299bc5fb21b7f715c6d0e243c 100644 (file)
@@ -1721,7 +1721,7 @@ fn name_from_pat(p: &ast::Pat) -> String {
         PatStruct(..) => fail!("tried to get argument name from pat_struct, \
                                 which is not allowed in function arguments"),
         PatTup(..) => "(tuple arg NYI)".to_string(),
-        PatUniq(p) => name_from_pat(p),
+        PatBox(p) => name_from_pat(p),
         PatRegion(p) => name_from_pat(p),
         PatLit(..) => {
             warn!("tried to get argument name from PatLit, \
index 69a92a871855c82158f62cf439a190cd71899866..9ddfd9bc637d2153f3bac59e9a66ea24c04331ea 100644 (file)
@@ -347,7 +347,7 @@ pub enum Pat_ {
                                      * we don't bind the fields to names */
     PatStruct(Path, Vec<FieldPat> , bool),
     PatTup(Vec<@Pat> ),
-    PatUniq(@Pat),
+    PatBox(@Pat),
     PatRegion(@Pat), // reference pattern
     PatLit(@Expr),
     PatRange(@Expr, @Expr),
index 3e41e58fbe21827e4a517d97960f7ccbb1151986..3dd16944a84bdc8c4d9d2494ad74537f0a3055df 100644 (file)
@@ -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) => {
index 1607820326bb55cfe0e594f7f9df7cda788ebca5..011e2e536f261fff18ee4519c7bfcee0fe7ed73b 100644 (file)
@@ -760,7 +760,7 @@ pub fn noop_fold_pat<T: Folder>(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))
index 6832555f728c01b666a309138479147d968edb2d..a43e88d6d65df780859522b82748fe97d40db838 100644 (file)
@@ -39,7 +39,7 @@
 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 @@ pub fn parse_pat(&mut self) -> @Pat {
             // 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 @@ pub fn parse_pat(&mut self) -> @Pat {
             // 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,
index 3cb2d0b421c2f3c312d94713b9c790d98e1c783f..31c2ef9a8d1636b4b2e9aa082209c85bf3700652 100644 (file)
@@ -1721,7 +1721,7 @@ pub fn print_pat(&mut self, pat: &ast::Pat) -> IoResult<()> {
                 }
                 try!(self.pclose());
             }
-            ast::PatUniq(inner) => {
+            ast::PatBox(inner) => {
                 try!(word(&mut self.s, "box "));
                 try!(self.print_pat(inner));
             }
index ce10d0db3ba75d88c94b01501d0b2db0295c6d0d..d17eba18643f9847c5d1a85edf0580c1b0601c92 100644 (file)
@@ -429,7 +429,7 @@ pub fn walk_pat<E: Clone, V: Visitor<E>>(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)
         }