When encountering invalid token after unsafe
, mention {
This commit is contained in:
parent
1670a532dd
commit
1aad320974
3 changed files with 28 additions and 0 deletions
|
@ -6469,6 +6469,8 @@ impl<'a> Parser<'a> {
|
|||
&& self.look_ahead(1, |t| *t != token::OpenDelim(token::Brace)) {
|
||||
// UNSAFE FUNCTION ITEM
|
||||
self.bump(); // `unsafe`
|
||||
// `{` is also expected after `unsafe`, in case of error, include it in the diagnostic
|
||||
self.check(&token::OpenDelim(token::Brace));
|
||||
let abi = if self.eat_keyword(keywords::Extern) {
|
||||
self.parse_opt_abi()?.unwrap_or(Abi::C)
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue