File tree Expand file tree Collapse file tree 2 files changed +26
-4
lines changed Expand file tree Collapse file tree 2 files changed +26
-4
lines changed Original file line number Diff line number Diff line change @@ -4186,10 +4186,10 @@ pub impl Parser {
4186
4186
return iovi_foreign_item ( item) ;
4187
4187
}
4188
4188
if ( self . is_keyword ( "fn" ) || self . is_keyword ( "pure" ) ||
4189
- self . is_keyword ( "unsafe" ) ) {
4189
+ self . is_keyword ( "unsafe" ) ) {
4190
4190
// FOREIGN FUNCTION ITEM
4191
- let item = self . parse_item_foreign_fn ( attrs) ;
4192
- return iovi_foreign_item ( item) ;
4191
+ let item = self . parse_item_foreign_fn ( attrs) ;
4192
+ return iovi_foreign_item ( item) ;
4193
4193
}
4194
4194
self . parse_macro_use_or_failure ( attrs, macros_allowed, lo, visibility)
4195
4195
}
@@ -4504,7 +4504,12 @@ pub impl Parser {
4504
4504
let mut foreign_items = ~[ ] ;
4505
4505
loop {
4506
4506
match self . parse_foreign_item ( /*bad*/ copy attrs, macros_allowed) {
4507
- iovi_none => break ,
4507
+ iovi_none => {
4508
+ if * self . token == token:: RBRACE {
4509
+ break
4510
+ }
4511
+ self . unexpected ( ) ;
4512
+ } ,
4508
4513
iovi_view_item( view_item) => {
4509
4514
// I think this can't occur:
4510
4515
self . span_err ( view_item. span ,
Original file line number Diff line number Diff line change
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:unexpected token
12
+ extern {
13
+ f( ) ;
14
+ }
15
+
16
+ fn main ( ) {
17
+ }
You can’t perform that action at this time.
0 commit comments