Skip to content

Commit d655143

Browse files
committed
---
yaml --- r: 47465 b: refs/heads/try c: e94465c h: refs/heads/master i: 47463: d0d24c8 v: v3
1 parent 846aa0c commit d655143

File tree

3 files changed

+31
-6
lines changed

3 files changed

+31
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 3bbcac322669cff3abde5be937cc4ec3860f3985
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d9689399d091c3265f00434a69c551a61c28dc
5-
refs/heads/try: afd6196d7b87401d20dc5149c6955e2c9758657f
5+
refs/heads/try: e94465c053b06a5e4e0394812a12f4f6e027a98e
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/libsyntax/ext/expand.rs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,14 @@ pub fn expand_expr(extsbox: @mut SyntaxEnv,
3737
// entry-point for all syntax extensions.
3838
expr_mac(ref mac) => {
3939
match (*mac).node {
40-
// Token-tree macros, these will be the only case when we're
41-
// finished transitioning.
40+
// Token-tree macros:
4241
mac_invoc_tt(pth, ref tts) => {
43-
assert (vec::len(pth.idents) == 1u);
42+
if (pth.idents.len() > 1u) {
43+
cx.span_fatal(
44+
pth.span,
45+
fmt!("expected macro name without module \
46+
separators"));
47+
}
4448
/* using idents and token::special_idents would make the
4549
the macro names be hygienic */
4650
let extname = cx.parse_sess().interner.get(pth.idents[0]);
@@ -319,8 +323,12 @@ pub fn expand_stmt(extsbox: @mut SyntaxEnv,
319323
}
320324
_ => return orig(s, sp, fld)
321325
};
322-
323-
assert(vec::len(pth.idents) == 1u);
326+
if (pth.idents.len() > 1u) {
327+
cx.span_fatal(
328+
pth.span,
329+
fmt!("expected macro name without module \
330+
separators"));
331+
}
324332
let extname = cx.parse_sess().interner.get(pth.idents[0]);
325333
let (fully_expanded, sp) = match (*extsbox).find(&extname) {
326334
None =>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// error-pattern:expected macro name without module separators
12+
13+
fn main() {
14+
globnar::brotz!();
15+
}
16+
17+

0 commit comments

Comments
 (0)