Auto merge of #79433 - calebcartwright:parse-attr-vis, r=petrochenkov

rustc_parse: restore public visibility on parse_attribute

Make `parse_attribute` public as rustfmt is a downstream consumer. Refs https://github.com/rust-lang/rust/pull/78782#discussion_r530658904

r? `@petrochenkov`
This commit is contained in:
bors 2020-11-27 11:23:11 +00:00
commit 361543d776

View file

@ -8,8 +8,9 @@ use rustc_span::{sym, Span};
use tracing::debug; use tracing::debug;
// Public for rustfmt usage
#[derive(Debug)] #[derive(Debug)]
pub(super) enum InnerAttrPolicy<'a> { pub enum InnerAttrPolicy<'a> {
Permitted, Permitted,
Forbidden { reason: &'a str, saw_doc_comment: bool, prev_attr_sp: Option<Span> }, Forbidden { reason: &'a str, saw_doc_comment: bool, prev_attr_sp: Option<Span> },
} }
@ -78,7 +79,8 @@ impl<'a> Parser<'a> {
/// Matches `attribute = # ! [ meta_item ]`. /// Matches `attribute = # ! [ meta_item ]`.
/// `inner_parse_policy` prescribes how to handle inner attributes. /// `inner_parse_policy` prescribes how to handle inner attributes.
fn parse_attribute( // Public for rustfmt usage.
pub fn parse_attribute(
&mut self, &mut self,
inner_parse_policy: InnerAttrPolicy<'_>, inner_parse_policy: InnerAttrPolicy<'_>,
) -> PResult<'a, ast::Attribute> { ) -> PResult<'a, ast::Attribute> {