diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index aca1fae6a3c8e..c670283e559d9 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -202,7 +202,7 @@ fn expand_mac_invoc(mac: ast::Mac, ident: Option, attrs: Vec 1 { + if path.segments.len() > 1 || path.global || !path.segments[0].parameters.is_empty() { fld.cx.span_err(path.span, "expected macro name without module separators"); return None; } diff --git a/src/test/compile-fail/macro-with-seps-err-msg.rs b/src/test/compile-fail/macro-with-seps-err-msg.rs index 95250e36b8685..408bb15ba28cd 100644 --- a/src/test/compile-fail/macro-with-seps-err-msg.rs +++ b/src/test/compile-fail/macro-with-seps-err-msg.rs @@ -8,8 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:expected macro name without module separators - fn main() { - globnar::brotz!(); + globnar::brotz!(); //~ ERROR expected macro name without module separators + ::foo!(); //~ ERROR expected macro name without module separators + foo::!(); //~ ERROR expected macro name without module separators }