Skip to content

Commit 5428d4e

Browse files
committed
Check for nonconsistent macro names.
1 parent e39d835 commit 5428d4e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/comp/syntax/ext/simplext.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,17 @@ fn add_new_extension(cx: &ext_ctxt, sp: span, arg: @expr,
675675
alt mac.node {
676676
mac_invoc(pth, invoc_arg, body) {
677677
alt path_to_ident(pth) {
678-
some(id) { macro_name = some(id); }
678+
some(id) {
679+
alt macro_name {
680+
none. { macro_name = some(id); }
681+
some(other_id) {
682+
if id != other_id {
683+
cx.span_fatal(pth.span, "macro name must be "
684+
+ "consistent");
685+
}
686+
}
687+
}
688+
}
679689
none. {
680690
cx.span_fatal(pth.span,
681691
"macro name must not be a path");

0 commit comments

Comments
 (0)