Skip to content

Commit 4e3db5e

Browse files
committed
Rename PatUniq to PatBox. Fixes part of #13910.
1 parent 73dac7e commit 4e3db5e

File tree

14 files changed

+20
-20
lines changed

14 files changed

+20
-20
lines changed

src/librustc/middle/cfg/construct.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl<'a> CFGBuilder<'a> {
113113
self.add_node(pat.id, [pred])
114114
}
115115

116-
ast::PatUniq(subpat) |
116+
ast::PatBox(subpat) |
117117
ast::PatRegion(subpat) |
118118
ast::PatIdent(_, _, Some(subpat)) => {
119119
let subpat_exit = self.pat(subpat, pred);

src/librustc/middle/check_match.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ fn pat_ctor_id(cx: &MatchCheckCtxt, p: @Pat) -> Option<ctor> {
383383
_ => Some(single)
384384
}
385385
}
386-
PatUniq(_) | PatTup(_) | PatRegion(..) => {
386+
PatBox(_) | PatTup(_) | PatRegion(..) => {
387387
Some(single)
388388
}
389389
PatVec(ref before, slice, ref after) => {
@@ -763,7 +763,7 @@ fn specialize(cx: &MatchCheckCtxt,
763763
PatTup(args) => {
764764
Some(args.iter().map(|x| *x).collect::<Vec<_>>().append(r.tail()))
765765
}
766-
PatUniq(a) | PatRegion(a) => {
766+
PatBox(a) | PatRegion(a) => {
767767
Some((vec!(a)).append(r.tail()))
768768
}
769769
PatLit(expr) => {
@@ -919,7 +919,7 @@ fn find_refutable(cx: &MatchCheckCtxt, pat: &Pat, spans: &mut Vec<Span>) {
919919
}
920920

921921
match pat.node {
922-
PatUniq(sub) | PatRegion(sub) | PatIdent(_, _, Some(sub)) => {
922+
PatBox(sub) | PatRegion(sub) | PatIdent(_, _, Some(sub)) => {
923923
find_refutable(cx, sub, spans)
924924
}
925925
PatWild | PatWildMulti | PatIdent(_, _, None) => {}

src/librustc/middle/mem_categorization.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,7 @@ impl<'t,TYPER:Typer> MemCategorizationContext<'t,TYPER> {
10641064
}
10651065
}
10661066

1067-
ast::PatUniq(subpat) | ast::PatRegion(subpat) => {
1067+
ast::PatBox(subpat) | ast::PatRegion(subpat) => {
10681068
// @p1, ~p1
10691069
let subcmt = self.cat_deref(pat, cmt, 0);
10701070
if_ok!(self.cat_pattern(subcmt, subpat, op));

src/librustc/middle/region.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ fn resolve_local(visitor: &mut RegionResolutionVisitor,
671671
subpats.iter().any(|&p| is_binding_pat(p))
672672
}
673673

674-
ast::PatUniq(subpat) => {
674+
ast::PatBox(subpat) => {
675675
is_binding_pat(subpat)
676676
}
677677

src/librustc/middle/trans/_match.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ fn enter_uniq<'a, 'b>(
838838
let dummy = @ast::Pat {id: 0, node: ast::PatWild, span: DUMMY_SP};
839839
enter_match(bcx, dm, m, col, val, |p| {
840840
match p.node {
841-
ast::PatUniq(sub) => {
841+
ast::PatBox(sub) => {
842842
Some(vec!(sub))
843843
}
844844
_ => {
@@ -1105,7 +1105,7 @@ macro_rules! any_pat (
11051105
)
11061106

11071107
fn any_uniq_pat(m: &[Match], col: uint) -> bool {
1108-
any_pat!(m, ast::PatUniq(_))
1108+
any_pat!(m, ast::PatBox(_))
11091109
}
11101110

11111111
fn any_region_pat(m: &[Match], col: uint) -> bool {
@@ -2270,7 +2270,7 @@ fn bind_irrefutable_pat<'a>(
22702270
binding_mode, cleanup_scope);
22712271
}
22722272
}
2273-
ast::PatUniq(inner) => {
2273+
ast::PatBox(inner) => {
22742274
let llbox = Load(bcx, val);
22752275
bcx = bind_irrefutable_pat(bcx, inner, llbox, binding_mode, cleanup_scope);
22762276
}

src/librustc/middle/trans/debuginfo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2633,7 +2633,7 @@ fn populate_scope_map(cx: &CrateContext,
26332633
}
26342634
}
26352635

2636-
ast::PatUniq(sub_pat) | ast::PatRegion(sub_pat) => {
2636+
ast::PatBox(sub_pat) | ast::PatRegion(sub_pat) => {
26372637
scope_map.insert(pat.id, scope_stack.last().unwrap().scope_metadata);
26382638
walk_pattern(cx, sub_pat, scope_stack, scope_map);
26392639
}

src/librustc/middle/typeck/check/_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ pub fn check_pat(pcx: &pat_ctxt, pat: &ast::Pat, expected: ty::t) {
634634
}
635635
}
636636
}
637-
ast::PatUniq(inner) => {
637+
ast::PatBox(inner) => {
638638
check_pointer_pat(pcx, Send, inner, pat.id, pat.span, expected);
639639
}
640640
ast::PatRegion(inner) => {

src/librustdoc/clean/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1721,7 +1721,7 @@ fn name_from_pat(p: &ast::Pat) -> String {
17211721
PatStruct(..) => fail!("tried to get argument name from pat_struct, \
17221722
which is not allowed in function arguments"),
17231723
PatTup(..) => "(tuple arg NYI)".to_string(),
1724-
PatUniq(p) => name_from_pat(p),
1724+
PatBox(p) => name_from_pat(p),
17251725
PatRegion(p) => name_from_pat(p),
17261726
PatLit(..) => {
17271727
warn!("tried to get argument name from PatLit, \

src/libsyntax/ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ pub enum Pat_ {
347347
* we don't bind the fields to names */
348348
PatStruct(Path, Vec<FieldPat> , bool),
349349
PatTup(Vec<@Pat> ),
350-
PatUniq(@Pat),
350+
PatBox(@Pat),
351351
PatRegion(@Pat), // reference pattern
352352
PatLit(@Expr),
353353
PatRange(@Expr, @Expr),

src/libsyntax/ast_util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ pub fn walk_pat(pat: &Pat, it: |&Pat| -> bool) -> bool {
657657
PatEnum(_, Some(ref s)) | PatTup(ref s) => {
658658
s.iter().advance(|&p| walk_pat(p, |p| it(p)))
659659
}
660-
PatUniq(s) | PatRegion(s) => {
660+
PatBox(s) | PatRegion(s) => {
661661
walk_pat(s, it)
662662
}
663663
PatVec(ref before, ref slice, ref after) => {

src/libsyntax/fold.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ pub fn noop_fold_pat<T: Folder>(p: @Pat, folder: &mut T) -> @Pat {
760760
PatStruct(pth_, fs, etc)
761761
}
762762
PatTup(ref elts) => PatTup(elts.iter().map(|x| folder.fold_pat(*x)).collect()),
763-
PatUniq(inner) => PatUniq(folder.fold_pat(inner)),
763+
PatBox(inner) => PatBox(folder.fold_pat(inner)),
764764
PatRegion(inner) => PatRegion(folder.fold_pat(inner)),
765765
PatRange(e1, e2) => {
766766
PatRange(folder.fold_expr(e1), folder.fold_expr(e2))

src/libsyntax/parse/parser.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ use ast::{MutImmutable, MutMutable, Mac_, MacInvocTT, Matcher, MatchNonterminal}
3939
use ast::{MatchSeq, MatchTok, Method, MutTy, BiMul, Mutability};
4040
use ast::{NamedField, UnNeg, NoReturn, UnNot, P, Pat, PatEnum};
4141
use ast::{PatIdent, PatLit, PatRange, PatRegion, PatStruct};
42-
use ast::{PatTup, PatUniq, PatWild, PatWildMulti};
42+
use ast::{PatTup, PatBox, PatWild, PatWildMulti};
4343
use ast::{BiRem, Required};
4444
use ast::{RetStyle, Return, BiShl, BiShr, Stmt, StmtDecl};
4545
use ast::{Sized, DynSize, StaticSize};
@@ -2784,7 +2784,7 @@ impl<'a> Parser<'a> {
27842784
// parse ~pat
27852785
self.bump();
27862786
let sub = self.parse_pat();
2787-
pat = PatUniq(sub);
2787+
pat = PatBox(sub);
27882788
hi = self.last_span.hi;
27892789
self.obsolete(self.last_span, ObsoleteOwnedPattern);
27902790
return @ast::Pat {
@@ -2888,7 +2888,7 @@ impl<'a> Parser<'a> {
28882888
// FIXME(#13910): Rename to `PatBox` and extend to full DST
28892889
// support.
28902890
let sub = self.parse_pat();
2891-
pat = PatUniq(sub);
2891+
pat = PatBox(sub);
28922892
hi = self.last_span.hi;
28932893
return @ast::Pat {
28942894
id: ast::DUMMY_NODE_ID,

src/libsyntax/print/pprust.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1721,7 +1721,7 @@ impl<'a> State<'a> {
17211721
}
17221722
try!(self.pclose());
17231723
}
1724-
ast::PatUniq(inner) => {
1724+
ast::PatBox(inner) => {
17251725
try!(word(&mut self.s, "box "));
17261726
try!(self.print_pat(inner));
17271727
}

src/libsyntax/visit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ pub fn walk_pat<E: Clone, V: Visitor<E>>(visitor: &mut V, pattern: &Pat, env: E)
429429
visitor.visit_pat(*tuple_element, env.clone())
430430
}
431431
}
432-
PatUniq(subpattern) |
432+
PatBox(subpattern) |
433433
PatRegion(subpattern) => {
434434
visitor.visit_pat(subpattern, env)
435435
}

0 commit comments

Comments
 (0)