diff options
| author | Steve Klabnik <steve@steveklabnik.com> | 2016-05-07 15:35:17 -0400 |
|---|---|---|
| committer | Steve Klabnik <steve@steveklabnik.com> | 2016-05-07 15:35:17 -0400 |
| commit | a8162171fdc1a0400f340454ebbca8aa4cd90007 (patch) | |
| tree | 953a214e7272564c43654a953e3c20d64fd2aa89 /src/libsyntax/parse | |
| parent | b651b2c8af0bb98557a4f283a878c65b5ce25fc7 (diff) | |
| parent | b75f81c9b3f996100c72f9141dcf6161f8fc90f4 (diff) | |
| download | rust-a8162171fdc1a0400f340454ebbca8aa4cd90007.tar.gz rust-a8162171fdc1a0400f340454ebbca8aa4cd90007.zip | |
Rollup merge of #33336 - birkenfeld:issue-27361, r=sfackler
parser: do not try to continue with `unsafe` on foreign fns The changed line makes it look like `unsafe` is allowed, but the first statement of `parse_item_foreign_fn` is: ``` self.expect_keyword(keywords::Fn)?; ``` So we get the strange "expected one of `fn`, `pub`, `static`, or `unsafe`, found `unsafe`". Fixes: #27361
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 94e7d0a3939..48368cc025c 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -6013,7 +6013,7 @@ impl<'a> Parser<'a> { // FOREIGN STATIC ITEM return Ok(Some(self.parse_item_foreign_static(visibility, lo, attrs)?)); } - if self.check_keyword(keywords::Fn) || self.check_keyword(keywords::Unsafe) { + if self.check_keyword(keywords::Fn) { // FOREIGN FUNCTION ITEM return Ok(Some(self.parse_item_foreign_fn(visibility, lo, attrs)?)); } |
