Skip to content

Commit 608f7cc

Browse files
committed
Move ast::pat_id_map to ast::util
1 parent 4d92cb5 commit 608f7cc

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/comp/middle/trans_alt.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ type match_branch =
6969
bound: bind_map,
7070
data: @{body: BasicBlockRef,
7171
guard: option::t<@ast::expr>,
72-
id_map: ast::pat_id_map}};
72+
id_map: ast_util::pat_id_map}};
7373
type match = [match_branch];
7474

7575
fn matches_always(p: &@ast::pat) -> bool {
@@ -464,7 +464,7 @@ fn compile_submatch(bcx: @block_ctxt, m: &match, vals: [ValueRef],
464464

465465
// Returns false for unreachable blocks
466466
fn make_phi_bindings(bcx: &@block_ctxt, map: &[exit_node],
467-
ids: &ast::pat_id_map) -> bool {
467+
ids: &ast_util::pat_id_map) -> bool {
468468
let our_block = bcx.llbb as uint;
469469
let success = true;
470470
for each item: @{key: ast::ident, val: ast::node_id} in ids.items() {

src/comp/middle/typeck.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1305,7 +1305,7 @@ fn check_lit(ccx: @crate_ctxt, lit: &@ast::lit) -> ty::t {
13051305

13061306
// Pattern checking is top-down rather than bottom-up so that bindings get
13071307
// their types immediately.
1308-
fn check_pat(fcx: &@fn_ctxt, map: &ast::pat_id_map, pat: &@ast::pat,
1308+
fn check_pat(fcx: &@fn_ctxt, map: &ast_util::pat_id_map, pat: &@ast::pat,
13091309
expected: ty::t) {
13101310
alt pat.node {
13111311
ast::pat_wild. { write::ty_only_fixup(fcx, pat.id, expected); }

src/comp/syntax/ast.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@ tag pat_ {
9898
pat_box(@pat);
9999
}
100100

101-
type pat_id_map = std::map::hashmap<str, ast::node_id>;
102-
103101
tag mutability { mut; imm; maybe_mut; }
104102

105103
tag kind { kind_pinned; kind_shared; kind_unique; }

src/comp/syntax/ast_util.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ fn def_id_of_def(d: def) -> def_id {
4343
}
4444
}
4545

46+
type pat_id_map = std::map::hashmap<str, ast::node_id>;
47+
4648
// This is used because same-named variables in alternative patterns need to
4749
// use the node_id of their namesake in the first pattern.
4850
fn pat_id_map(pat: &@pat) -> pat_id_map {

0 commit comments

Comments
 (0)