@@ -23,7 +23,7 @@ use ast::{EMPTY_CTXT, EnumDef, ExplicitSelf};
2323use ast:: { Expr , ExprKind } ;
2424use ast:: { Field , FnDecl } ;
2525use ast:: { ForeignItem , ForeignItemKind , FunctionRetTy } ;
26- use ast:: { Ident , Inherited , ImplItem , Item , ItemKind } ;
26+ use ast:: { Ident , ImplItem , Item , ItemKind } ;
2727use ast:: { Lit , LitKind , UintTy } ;
2828use ast:: Local ;
2929use ast:: MacStmtStyle ;
@@ -3631,8 +3631,8 @@ impl<'a> Parser<'a> {
36313631 fn parse_name_and_ty ( & mut self , pr : Visibility ,
36323632 attrs : Vec < Attribute > ) -> PResult < ' a , StructField > {
36333633 let lo = match pr {
3634- Inherited => self . span . lo ,
3635- Public => self . last_span . lo ,
3634+ Visibility :: Inherited => self . span . lo ,
3635+ Visibility :: Public => self . last_span . lo ,
36363636 } ;
36373637 if !self . token . is_plain_ident ( ) {
36383638 return Err ( self . fatal ( "expected ident" ) ) ;
@@ -3749,7 +3749,7 @@ impl<'a> Parser<'a> {
37493749 lo, hi, id /*id is good here*/ ,
37503750 ItemKind :: Mac ( spanned ( lo, hi,
37513751 Mac_ { path : pth, tts : tts, ctxt : EMPTY_CTXT } ) ) ,
3752- Inherited , attrs) ) ) ) ,
3752+ Visibility :: Inherited , attrs) ) ) ) ,
37533753 ast:: DUMMY_NODE_ID ) )
37543754 }
37553755 } else {
@@ -4686,7 +4686,7 @@ impl<'a> Parser<'a> {
46864686
46874687 fn complain_if_pub_macro ( & mut self , visa : Visibility , span : Span ) {
46884688 match visa {
4689- Public => {
4689+ Visibility :: Public => {
46904690 let is_macro_rules: bool = match self . token {
46914691 token:: Ident ( sid, _) => sid. name == intern ( "macro_rules" ) ,
46924692 _ => false ,
@@ -4704,7 +4704,7 @@ impl<'a> Parser<'a> {
47044704 . emit ( ) ;
47054705 }
47064706 }
4707- Inherited => ( ) ,
4707+ Visibility :: Inherited => ( ) ,
47084708 }
47094709 }
47104710
@@ -4974,7 +4974,7 @@ impl<'a> Parser<'a> {
49744974 if parse_pub == ParsePub :: Yes {
49754975 try!( p. parse_visibility ( ) )
49764976 } else {
4977- Inherited
4977+ Visibility :: Inherited
49784978 }
49794979 ) ,
49804980 id : ast:: DUMMY_NODE_ID ,
@@ -5020,16 +5020,16 @@ impl<'a> Parser<'a> {
50205020 let span = self . last_span ;
50215021 self . span_err ( span, "`pub` is not allowed here" ) ;
50225022 }
5023- return self . parse_single_struct_field ( Public , attrs) ;
5023+ return self . parse_single_struct_field ( Visibility :: Public , attrs) ;
50245024 }
50255025
5026- return self . parse_single_struct_field ( Inherited , attrs) ;
5026+ return self . parse_single_struct_field ( Visibility :: Inherited , attrs) ;
50275027 }
50285028
50295029 /// Parse visibility: PUB or nothing
50305030 fn parse_visibility ( & mut self ) -> PResult < ' a , Visibility > {
5031- if self . eat_keyword ( keywords:: Pub ) { Ok ( Public ) }
5032- else { Ok ( Inherited ) }
5031+ if self . eat_keyword ( keywords:: Pub ) { Ok ( Visibility :: Public ) }
5032+ else { Ok ( Visibility :: Inherited ) }
50335033 }
50345034
50355035 /// Given a termination token, parse all of the items in a module
@@ -5304,7 +5304,7 @@ impl<'a> Parser<'a> {
53045304
53055305 let last_span = self . last_span ;
53065306
5307- if visibility == ast:: Public {
5307+ if visibility == ast:: Visibility :: Public {
53085308 self . span_warn ( mk_sp ( lo, last_span. hi ) ,
53095309 "`pub extern crate` does not work as expected and should not be used. \
53105310 Likely to become an error. Prefer `extern crate` and `pub use`.") ;
@@ -5819,8 +5819,8 @@ impl<'a> Parser<'a> {
58195819
58205820 // FAILURE TO PARSE ITEM
58215821 match visibility {
5822- Inherited => { }
5823- Public => {
5822+ Visibility :: Inherited => { }
5823+ Visibility :: Public => {
58245824 let last_span = self . last_span ;
58255825 return Err ( self . span_fatal ( last_span, "unmatched visibility `pub`" ) ) ;
58265826 }
0 commit comments