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);
_ => Some(single)
}
}
- PatUniq(_) | PatTup(_) | PatRegion(..) => {
+ PatBox(_) | PatTup(_) | PatRegion(..) => {
Some(single)
}
PatVec(ref before, slice, ref after) => {
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) => {
}
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) => {}
}
}
- 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));
subpats.iter().any(|&p| is_binding_pat(p))
}
- ast::PatUniq(subpat) => {
+ ast::PatBox(subpat) => {
is_binding_pat(subpat)
}
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))
}
_ => {
)
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 {
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);
}
}
}
- 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);
}
}
}
}
- ast::PatUniq(inner) => {
+ ast::PatBox(inner) => {
check_pointer_pat(pcx, Send, inner, pat.id, pat.span, expected);
}
ast::PatRegion(inner) => {
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, \
* 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),
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) => {
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))
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};
// 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 {
// 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,
}
try!(self.pclose());
}
- ast::PatUniq(inner) => {
+ ast::PatBox(inner) => {
try!(word(&mut self.s, "box "));
try!(self.print_pat(inner));
}
visitor.visit_pat(*tuple_element, env.clone())
}
}
- PatUniq(subpattern) |
+ PatBox(subpattern) |
PatRegion(subpattern) => {
visitor.visit_pat(subpattern, env)
}