Skip to content

Commit ce5a481

Browse files
committed
---
yaml --- r: 14430 b: refs/heads/try c: 27ab663 h: refs/heads/master v: v3
1 parent d6c78f9 commit ce5a481

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: ffa77dd610bc15871d32b93228e680f94d30a5c6
5+
refs/heads/try: 27ab663845e66d908ec4e4549d333e95561dbe26
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/comp/syntax/parse/parser.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2068,7 +2068,6 @@ fn parse_mod_items(p: parser, term: token::token,
20682068
let initial_attrs = first_item_attrs;
20692069
while p.token != term {
20702070
let attrs = initial_attrs + parse_outer_attributes(p);
2071-
initial_attrs = [];
20722071
#debug["parse_mod_items: parse_item(attrs=%?)", attrs];
20732072
alt parse_item(p, attrs) {
20742073
some(i) { items += [i]; }
@@ -2078,7 +2077,14 @@ fn parse_mod_items(p: parser, term: token::token,
20782077
}
20792078
}
20802079
#debug["parse_mod_items: attrs=%?", attrs];
2080+
initial_attrs = [];
2081+
}
2082+
2083+
if vec::is_not_empty(initial_attrs) {
2084+
// We parsed attributes for the first item but didn't find the item
2085+
p.fatal("expected item");
20812086
}
2087+
20822088
ret {view_items: view_items, items: items};
20832089
}
20842090

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// error-pattern:expected item
2+
mod blade_runner {
3+
#[doc(
4+
brief = "Blade Runner is probably the best movie ever",
5+
desc = "I like that in the world of Blade Runner it is always
6+
raining, and that it's always night time. And Aliens
7+
was also a really good movie.
8+
9+
Alien 3 was crap though."
10+
)]
11+
}

0 commit comments

Comments
 (0)