1
Fork 0

Rollup merge of #56433 - yui-knk:update_comment_of_parse_visibility, r=petrochenkov

Add description about `crate` for parse_visibility's comment

This rule was introduced by https://github.com/rust-lang/rust/pull/45401.
This commit is contained in:
kennytm 2018-12-03 18:07:18 +08:00 committed by GitHub
commit a498a6d198
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6280,9 +6280,10 @@ impl<'a> Parser<'a> {
self.parse_single_struct_field(lo, vis, attrs)
}
/// Parse `pub`, `pub(crate)` and `pub(in path)` plus shortcuts `pub(self)` for `pub(in self)`
/// and `pub(super)` for `pub(in super)`. If the following element can't be a tuple (i.e. it's
/// a function definition, it's not a tuple struct field) and the contents within the parens
/// Parse `pub`, `pub(crate)` and `pub(in path)` plus shortcuts `crate` for `pub(crate)`,
/// `pub(self)` for `pub(in self)` and `pub(super)` for `pub(in super)`.
/// If the following element can't be a tuple (i.e. it's a function definition,
/// it's not a tuple struct field) and the contents within the parens
/// isn't valid, emit a proper diagnostic.
pub fn parse_visibility(&mut self, can_take_tuple: bool) -> PResult<'a, Visibility> {
maybe_whole!(self, NtVis, |x| x);