mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-06 20:28:33 +00:00
Check for nonconsistent macro names.
This commit is contained in:
parent
e39d835390
commit
5428d4ee6d
@ -675,7 +675,17 @@ fn add_new_extension(cx: &ext_ctxt, sp: span, arg: @expr,
|
|||||||
alt mac.node {
|
alt mac.node {
|
||||||
mac_invoc(pth, invoc_arg, body) {
|
mac_invoc(pth, invoc_arg, body) {
|
||||||
alt path_to_ident(pth) {
|
alt path_to_ident(pth) {
|
||||||
some(id) { macro_name = some(id); }
|
some(id) {
|
||||||
|
alt macro_name {
|
||||||
|
none. { macro_name = some(id); }
|
||||||
|
some(other_id) {
|
||||||
|
if id != other_id {
|
||||||
|
cx.span_fatal(pth.span, "macro name must be "
|
||||||
|
+ "consistent");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
none. {
|
none. {
|
||||||
cx.span_fatal(pth.span,
|
cx.span_fatal(pth.span,
|
||||||
"macro name must not be a path");
|
"macro name must not be a path");
|
||||||
|
Loading…
Reference in New Issue
Block a user