diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-02-22 21:47:23 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-02-22 21:47:23 -0800 |
| commit | 27ab663845e66d908ec4e4549d333e95561dbe26 (patch) | |
| tree | 18687d24a75bb04ca3a2a4770d148391411bf005 /src/comp/syntax/parse | |
| parent | ffa77dd610bc15871d32b93228e680f94d30a5c6 (diff) | |
rustc: Don't ignore attributes inside empty mods. Closes #1655
Diffstat (limited to 'src/comp/syntax/parse')
| -rw-r--r-- | src/comp/syntax/parse/parser.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs index 7cdb5667665..1a8fbdd917a 100644 --- a/src/comp/syntax/parse/parser.rs +++ b/src/comp/syntax/parse/parser.rs @@ -2068,7 +2068,6 @@ fn parse_mod_items(p: parser, term: token::token, let initial_attrs = first_item_attrs; while p.token != term { let attrs = initial_attrs + parse_outer_attributes(p); - initial_attrs = []; #debug["parse_mod_items: parse_item(attrs=%?)", attrs]; alt parse_item(p, attrs) { some(i) { items += [i]; } @@ -2078,7 +2077,14 @@ fn parse_mod_items(p: parser, term: token::token, } } #debug["parse_mod_items: attrs=%?", attrs]; + initial_attrs = []; + } + + if vec::is_not_empty(initial_attrs) { + // We parsed attributes for the first item but didn't find the item + p.fatal("expected item"); } + ret {view_items: view_items, items: items}; } |
