Skip to content

Commit efa4526

Browse files
committed
---
yaml --- r: 46744 b: refs/heads/auto c: e94465c h: refs/heads/master v: v3
1 parent 92e24cf commit efa4526

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
@@ -14,4 +14,4 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: afd6196d7b87401d20dc5149c6955e2c9758657f
17+
refs/heads/auto: e94465c053b06a5e4e0394812a12f4f6e027a98e

branches/auto/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)