diff --git a/src/librustc_parse/parser/item.rs b/src/librustc_parse/parser/item.rs
index 451f1fdf14a..c85b4c22d01 100644
--- a/src/librustc_parse/parser/item.rs
+++ b/src/librustc_parse/parser/item.rs
@@ -25,21 +25,15 @@ pub(super) type ItemInfo = (Ident, ItemKind);
impl<'a> Parser<'a> {
pub fn parse_item(&mut self) -> PResult<'a, Option
>> {
+ self.parse_item_(|_| true).map(|i| i.map(P))
+ }
+
+ fn parse_item_(&mut self, req_name: ReqName) -> PResult<'a, Option- > {
let attrs = self.parse_outer_attributes()?;
- self.parse_item_(attrs, true, false)
+ self.parse_item_common(attrs, true, false, req_name)
}
- pub(super) fn parse_item_(
- &mut self,
- attrs: Vec,
- macros_allowed: bool,
- attributes_allowed: bool,
- ) -> PResult<'a, Option
>> {
- let item = self.parse_item_common(attrs, macros_allowed, attributes_allowed, |_| true)?;
- Ok(item.map(P))
- }
-
- fn parse_item_common(
+ pub(super) fn parse_item_common(
&mut self,
mut attrs: Vec,
mac_allowed: bool,
@@ -653,9 +647,7 @@ impl<'a> Parser<'a> {
/// Parses associated items.
fn parse_assoc_item(&mut self, req_name: ReqName) -> PResult<'a, Option