Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/libsyntax/ext/tt/transcribe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 9 additions & 0 deletions src/test/compile-fail/issue-6596.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
macro_rules! e( //~ ERROR unknown macro variable `nonexistent`
($inp:ident) => (
$nonexistent
);
)

fn main() {
e!(foo);
}