diff options
| author | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-03-23 10:17:34 +0000 |
|---|---|---|
| committer | Jeffrey Seyfried <jeffrey.seyfried@gmail.com> | 2016-04-02 20:21:41 +0000 |
| commit | bc355244df5ae74eaabe9a1e19200b9160010505 (patch) | |
| tree | cab5dddff11c110cc554b8fe91e293a3a08461f9 /src/libsyntax/parse | |
| parent | 74240b22d92bbbdf4afac8cf14f81fd337b97a46 (diff) | |
| download | rust-bc355244df5ae74eaabe9a1e19200b9160010505.tar.gz rust-bc355244df5ae74eaabe9a1e19200b9160010505.zip | |
Make `ast::Visibility` non-copyable
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 9027a5b1074..1c0fc5fda25 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -4952,7 +4952,7 @@ impl<'a> Parser<'a> { self.commit_expr_expecting(&expr, token::Semi)?; (name, ast::ImplItemKind::Const(typ, expr)) } else { - let (name, inner_attrs, node) = self.parse_impl_method(vis)?; + let (name, inner_attrs, node) = self.parse_impl_method(&vis)?; attrs.extend(inner_attrs); (name, node) }; @@ -4968,8 +4968,8 @@ impl<'a> Parser<'a> { }) } - fn complain_if_pub_macro(&mut self, visa: Visibility, span: Span) { - match visa { + fn complain_if_pub_macro(&mut self, visa: &Visibility, span: Span) { + match *visa { Visibility::Public => { let is_macro_rules: bool = match self.token { token::Ident(sid, _) => sid.name == intern("macro_rules"), @@ -4993,7 +4993,7 @@ impl<'a> Parser<'a> { } /// Parse a method or a macro invocation in a trait impl. - fn parse_impl_method(&mut self, vis: Visibility) + fn parse_impl_method(&mut self, vis: &Visibility) -> PResult<'a, (Ident, Vec<ast::Attribute>, ast::ImplItemKind)> { // code copied from parse_macro_use_or_failure... abstraction! if !self.token.is_any_keyword() @@ -5003,7 +5003,7 @@ impl<'a> Parser<'a> { // method macro. let last_span = self.last_span; - self.complain_if_pub_macro(vis, last_span); + self.complain_if_pub_macro(&vis, last_span); let lo = self.span.lo; let pth = self.parse_path(NoTypesAllowed)?; @@ -6045,7 +6045,7 @@ impl<'a> Parser<'a> { // MACRO INVOCATION ITEM let last_span = self.last_span; - self.complain_if_pub_macro(visibility, last_span); + self.complain_if_pub_macro(&visibility, last_span); let mac_lo = self.span.lo; |
