Skip to content

Commit 4071ee3

Browse files
pnkfelixalexcrichton
authored andcommitted
---
yaml --- r: 151715 b: refs/heads/try2 c: 39b271f h: refs/heads/master i: 151713: 45f72c1 151711: 4d7aa39 v: v3
1 parent c2346e1 commit 4071ee3

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: b9e4fcbf04b21c39b5e704a1f24adbfe179f8814
8+
refs/heads/try2: 39b271f4a309b850c947f5c4e61c978a3cfbcd1e
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustc/middle/trans/monomorphize.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ pub fn monomorphic_fn(ccx: &CrateContext,
309309
ast_map::NodeStmt(..) |
310310
ast_map::NodeArg(..) |
311311
ast_map::NodeBlock(..) |
312+
ast_map::NodePat(..) |
312313
ast_map::NodeLocal(..) => {
313314
ccx.sess().bug(format!("can't monomorphize a {:?}", map_node))
314315
}

branches/try2/src/libsyntax/ast_map.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ pub enum Node {
103103
NodeStmt(@Stmt),
104104
NodeArg(@Pat),
105105
NodeLocal(@Pat),
106+
NodePat(@Pat),
106107
NodeBlock(P<Block>),
107108

108109
/// NodeStructCtor represents a tuple struct.
@@ -127,6 +128,7 @@ enum MapEntry {
127128
EntryStmt(NodeId, @Stmt),
128129
EntryArg(NodeId, @Pat),
129130
EntryLocal(NodeId, @Pat),
131+
EntryPat(NodeId, @Pat),
130132
EntryBlock(NodeId, P<Block>),
131133
EntryStructCtor(NodeId, @StructDef),
132134
EntryLifetime(NodeId, @Lifetime),
@@ -154,6 +156,7 @@ impl MapEntry {
154156
EntryStmt(id, _) => id,
155157
EntryArg(id, _) => id,
156158
EntryLocal(id, _) => id,
159+
EntryPat(id, _) => id,
157160
EntryBlock(id, _) => id,
158161
EntryStructCtor(id, _) => id,
159162
EntryLifetime(id, _) => id,
@@ -172,6 +175,7 @@ impl MapEntry {
172175
EntryStmt(_, p) => NodeStmt(p),
173176
EntryArg(_, p) => NodeArg(p),
174177
EntryLocal(_, p) => NodeLocal(p),
178+
EntryPat(_, p) => NodePat(p),
175179
EntryBlock(_, p) => NodeBlock(p),
176180
EntryStructCtor(_, p) => NodeStructCtor(p),
177181
EntryLifetime(_, p) => NodeLifetime(p),
@@ -399,6 +403,7 @@ impl Map {
399403
Some(NodeExpr(expr)) => expr.span,
400404
Some(NodeStmt(stmt)) => stmt.span,
401405
Some(NodeArg(pat)) | Some(NodeLocal(pat)) => pat.span,
406+
Some(NodePat(pat)) => pat.span,
402407
Some(NodeBlock(block)) => block.span,
403408
Some(NodeStructCtor(_)) => self.expect_item(self.get_parent(id)).span,
404409
_ => fail!("node_span: could not find span for id {}", id),
@@ -513,7 +518,9 @@ impl<'a, F: FoldOps> Folder for Ctx<'a, F> {
513518
// Note: this is at least *potentially* a pattern...
514519
self.insert(pat.id, EntryLocal(self.parent, pat));
515520
}
516-
_ => {}
521+
_ => {
522+
self.insert(pat.id, EntryPat(self.parent, pat));
523+
}
517524
}
518525

519526
pat
@@ -704,6 +711,9 @@ fn node_id_to_str(map: &Map, id: NodeId) -> StrBuf {
704711
(format!("local {} (id={})",
705712
pprust::pat_to_str(pat), id)).to_strbuf()
706713
}
714+
Some(NodePat(pat)) => {
715+
(format!("pat {} (id={})", pprust::pat_to_str(pat), id)).to_strbuf()
716+
}
707717
Some(NodeBlock(block)) => {
708718
(format!("block {} (id={})",
709719
pprust::block_to_str(block), id)).to_strbuf()

0 commit comments

Comments
 (0)