diff options
| author | Folkert <folkert@folkertdev.nl> | 2024-07-25 10:05:31 +0200 |
|---|---|---|
| committer | Folkert <folkert@folkertdev.nl> | 2024-07-25 22:33:52 +0200 |
| commit | d3858f7465a711852e162b42e7cb2a2a53cf1e83 (patch) | |
| tree | 983eb773dc494772d53aa1bcfaff72e92ddae125 /compiler/rustc_parse/src/parser/mod.rs | |
| parent | eb10639928a2781cf0a12440007fbcc1e3a6888f (diff) | |
| download | rust-d3858f7465a711852e162b42e7cb2a2a53cf1e83.tar.gz rust-d3858f7465a711852e162b42e7cb2a2a53cf1e83.zip | |
improve error message when `global_asm!` uses `asm!` options
Diffstat (limited to 'compiler/rustc_parse/src/parser/mod.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/mod.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs index 7326b9ec51f..e7240869a39 100644 --- a/compiler/rustc_parse/src/parser/mod.rs +++ b/compiler/rustc_parse/src/parser/mod.rs @@ -599,7 +599,7 @@ impl<'a> Parser<'a> { /// If the next token is the given keyword, eats it and returns `true`. /// Otherwise, returns `false`. An expectation is also added for diagnostics purposes. - // Public for rustfmt usage. + // Public for rustc_builtin_macros and rustfmt usage. #[inline] pub fn eat_keyword(&mut self, kw: Symbol) -> bool { if self.check_keyword(kw) { @@ -631,8 +631,11 @@ impl<'a> Parser<'a> { false } + /// If the next token is the given keyword, eats it and returns `true`. + /// Otherwise, returns `false`. No expectation is added. + // Public for rustc_builtin_macros usage. #[inline] - fn eat_keyword_noexpect(&mut self, kw: Symbol) -> bool { + pub fn eat_keyword_noexpect(&mut self, kw: Symbol) -> bool { if self.token.is_keyword(kw) { self.bump(); true |
