diff options
| author | Corey Richardson <corey@octayn.net> | 2013-05-22 14:21:09 -0400 |
|---|---|---|
| committer | Corey Richardson <corey@octayn.net> | 2013-05-22 19:18:50 -0400 |
| commit | 7ccc97e5b4fb6a9a3fb76b806df4e22b9401a47c (patch) | |
| tree | 68e0979e175e6d4eada83077c8749857a64de452 | |
| parent | b6a0d40c1d5e4e69717b688a6377f5a96937964b (diff) | |
| download | rust-7ccc97e5b4fb6a9a3fb76b806df4e22b9401a47c.tar.gz rust-7ccc97e5b4fb6a9a3fb76b806df4e22b9401a47c.zip | |
Fix ICE in macros
| -rw-r--r-- | src/libsyntax/ext/tt/transcribe.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/libsyntax/ext/tt/transcribe.rs b/src/libsyntax/ext/tt/transcribe.rs index d806801b7d1..b13dc3f3c0f 100644 --- a/src/libsyntax/ext/tt/transcribe.rs +++ b/src/libsyntax/ext/tt/transcribe.rs @@ -118,10 +118,13 @@ fn lookup_cur_matched_by_matched(r: &mut TtReader, } fn lookup_cur_matched(r: &mut TtReader, name: ident) -> @named_match { - // FIXME (#3850): this looks a bit silly with an extra scope. - let start; - { start = *r.interpolations.get(&name); } - return lookup_cur_matched_by_matched(r, start); + match r.interpolations.find_copy(&name) { + Some(s) => lookup_cur_matched_by_matched(r, s), + None => { + r.sp_diag.span_fatal(r.cur_span, fmt!("unknown macro variable `%s`", + *r.interner.get(name))); + } + } } enum lis { lis_unconstrained, lis_constraint(uint, ident), lis_contradiction(~str) |
