From 70371fde17ea4b1e3aa4d443103a15157eafdcdc Mon Sep 17 00:00:00 2001 From: yui-knk Date: Sun, 2 Dec 2018 17:01:44 +0900 Subject: [PATCH 1/2] Add description about `crate` for parse_visibility's comment This rule was introduced by https://github.com/rust-lang/rust/pull/45401. --- src/libsyntax/parse/parser.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index f13bb7df0b444..6c119dd3e76a5 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -6282,7 +6282,7 @@ 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)` + /// 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. From 172ec724af5013e9e9b2cf8f3bc12eda2db52876 Mon Sep 17 00:00:00 2001 From: yui-knk Date: Sun, 2 Dec 2018 18:33:12 +0900 Subject: [PATCH 2/2] Fix "line longer than 100 chars" --- src/libsyntax/parse/parser.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 6c119dd3e76a5..4884e5e28c0ae 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -6282,9 +6282,10 @@ impl<'a> Parser<'a> { self.parse_single_struct_field(lo, vis, attrs) } - /// 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 + /// 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);