libsyntax: Fix parsing of pub unsafe fn inside extern blocks. rs=bugfix

This commit is contained in:
Patrick Walton 2013-01-23 15:12:55 -08:00
parent ab13beb05a
commit d9c842847d
2 changed files with 12 additions and 1 deletions

View File

@ -3652,7 +3652,8 @@ impl Parser {
visibility,
maybe_append(attrs, extra_attrs)));
} else if foreign_items_allowed &&
(self.is_keyword(~"fn") || self.is_keyword(~"pure")) {
(self.is_keyword(~"fn") || self.is_keyword(~"pure") ||
self.is_keyword(~"unsafe")) {
let item = self.parse_item_foreign_fn(attrs);
return iovi_foreign_item(item);
} else if items_allowed && self.is_keyword(~"unsafe")

View File

@ -0,0 +1,10 @@
extern {
pub unsafe fn vec_reserve_shared_actual(++t: *sys::TypeDesc,
++v: **vec::raw::VecRepr,
++n: libc::size_t);
}
fn main() {
}