diff options
| author | bors <bors@rust-lang.org> | 2020-11-27 11:23:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-11-27 11:23:11 +0000 |
| commit | 361543d776d832b42f022f5b3aa1ab77263bc4a9 (patch) | |
| tree | 7d81f7f96ac20bbb0a3c8e5027d4ffc0d5a0a939 /compiler/rustc_parse/src/parser | |
| parent | 72d2a7cd357894be4076a6352da587e499c549b9 (diff) | |
| parent | 5930a8ab1258e9de11cdc6dc8a9275e44ea7d38e (diff) | |
| download | rust-361543d776d832b42f022f5b3aa1ab77263bc4a9.tar.gz rust-361543d776d832b42f022f5b3aa1ab77263bc4a9.zip | |
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`
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/attr.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/attr.rs b/compiler/rustc_parse/src/parser/attr.rs index 41985757b57..fae09fa6fec 100644 --- a/compiler/rustc_parse/src/parser/attr.rs +++ b/compiler/rustc_parse/src/parser/attr.rs @@ -8,8 +8,9 @@ use rustc_span::{sym, Span}; use tracing::debug; +// Public for rustfmt usage #[derive(Debug)] -pub(super) enum InnerAttrPolicy<'a> { +pub enum InnerAttrPolicy<'a> { Permitted, 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 ]`. /// `inner_parse_policy` prescribes how to handle inner attributes. - fn parse_attribute( + // Public for rustfmt usage. + pub fn parse_attribute( &mut self, inner_parse_policy: InnerAttrPolicy<'_>, ) -> PResult<'a, ast::Attribute> { |
