mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 18:53:39 +00:00
libsyntax: Fix parsing of pub unsafe fn
inside extern
blocks. rs=bugfix
This commit is contained in:
parent
ab13beb05a
commit
d9c842847d
@ -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")
|
||||
|
10
src/test/run-pass/extern-pub.rs
Normal file
10
src/test/run-pass/extern-pub.rs
Normal 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() {
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user