Relocate `is_const_item`.
This commit is contained in:
parent
63a9030e7b
commit
fa828d7a05
|
@ -710,13 +710,6 @@ impl<'a> Parser<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Returns `true` if we are looking at `const ID`
|
||||
/// (returns `false` for things like `const fn`, etc.).
|
||||
fn is_const_item(&self) -> bool {
|
||||
self.token.is_keyword(kw::Const) &&
|
||||
!self.is_keyword_ahead(1, &[kw::Fn, kw::Unsafe])
|
||||
}
|
||||
|
||||
/// Parses `auto? trait Foo { ... }` or `trait Foo = Bar;`.
|
||||
fn parse_item_trait(&mut self, lo: Span, unsafety: Unsafety) -> PResult<'a, ItemInfo> {
|
||||
// Parse optional `auto` prefix.
|
||||
|
@ -866,6 +859,13 @@ impl<'a> Parser<'a> {
|
|||
})
|
||||
}
|
||||
|
||||
/// Returns `true` if we are looking at `const ID`
|
||||
/// (returns `false` for things like `const fn`, etc.).
|
||||
fn is_const_item(&self) -> bool {
|
||||
self.token.is_keyword(kw::Const) &&
|
||||
!self.is_keyword_ahead(1, &[kw::Fn, kw::Unsafe])
|
||||
}
|
||||
|
||||
/// This parses the grammar:
|
||||
///
|
||||
/// AssocConst = "const" Ident ":" Ty "=" Expr ";"
|
||||
|
|
Loading…
Reference in New Issue