diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2020-02-11 08:40:16 +0100 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2020-02-13 10:40:17 +0100 |
| commit | 9828559aad8672bb320517bd0fa1992ce144b848 (patch) | |
| tree | f5f5389477017c943087b76cdbec10c1a58b5b53 /src | |
| parent | 4ca3bbf0b21c82d50d14aca9b74a4dd919d9087f (diff) | |
parser: is_fn_front_matter -> check_fn_front_matter
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_parse/parser/item.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/librustc_parse/parser/item.rs b/src/librustc_parse/parser/item.rs index d16eb770951..ccd55c5c08a 100644 --- a/src/librustc_parse/parser/item.rs +++ b/src/librustc_parse/parser/item.rs @@ -96,7 +96,7 @@ impl<'a> Parser<'a> { return Ok(Some(item)); } - if self.is_fn_front_matter() { + if self.check_fn_front_matter() { // FUNCTION ITEM let (ident, sig, generics, body) = self.parse_fn(&mut false, &mut attrs, |_| true)?; let kind = ItemKind::Fn(sig, generics, body); @@ -742,7 +742,7 @@ impl<'a> Parser<'a> { let defaultness = self.parse_defaultness(); let (name, kind, generics) = if self.eat_keyword(kw::Type) { self.parse_assoc_ty()? - } else if self.is_fn_front_matter() { + } else if self.check_fn_front_matter() { let (ident, sig, generics, body) = self.parse_fn(at_end, &mut attrs, req_name)?; (ident, AssocItemKind::Fn(sig, body), generics) } else if let Some(mac) = self.parse_assoc_macro_invoc("associated", Some(&vis), at_end)? { @@ -978,7 +978,7 @@ impl<'a> Parser<'a> { if self.check_keyword(kw::Type) { // FOREIGN TYPE ITEM self.parse_item_foreign_type(vis, lo, attrs) - } else if self.is_fn_front_matter() { + } else if self.check_fn_front_matter() { // FOREIGN FUNCTION ITEM let (ident, sig, generics, body) = self.parse_fn(&mut false, &mut attrs, |_| true)?; let kind = ForeignItemKind::Fn(sig, generics, body); @@ -1658,7 +1658,7 @@ impl<'a> Parser<'a> { } /// Is the current token the start of an `FnHeader` / not a valid parse? - fn is_fn_front_matter(&mut self) -> bool { + fn check_fn_front_matter(&mut self) -> bool { // We use an over-approximation here. // `const const`, `fn const` won't parse, but we're not stepping over other syntax either. const QUALS: [Symbol; 4] = [kw::Const, kw::Async, kw::Unsafe, kw::Extern]; |
