From 3dcd2157403163789aaf21a9ab3c4d30a7c6494d Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Thu, 6 Nov 2014 00:05:53 -0800 Subject: Switch to purely namespaced enums This breaks code that referred to variant names in the same namespace as their enum. Reexport the variants in the old location or alter code to refer to the new locations: ``` pub enum Foo { A, B } fn main() { let a = A; } ``` => ``` pub use self::Foo::{A, B}; pub enum Foo { A, B } fn main() { let a = A; } ``` or ``` pub enum Foo { A, B } fn main() { let a = Foo::A; } ``` [breaking-change] --- src/libsyntax/parse/lexer/comments.rs | 2 ++ src/libsyntax/parse/obsolete.rs | 2 ++ src/libsyntax/parse/parser.rs | 3 +++ src/libsyntax/parse/token.rs | 7 +++++++ 4 files changed, 14 insertions(+) (limited to 'src/libsyntax/parse') diff --git a/src/libsyntax/parse/lexer/comments.rs b/src/libsyntax/parse/lexer/comments.rs index 5a7679570bf..b62d2d744c9 100644 --- a/src/libsyntax/parse/lexer/comments.rs +++ b/src/libsyntax/parse/lexer/comments.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +pub use self::CommentStyle::*; + use ast; use codemap::{BytePos, CharPos, CodeMap, Pos}; use diagnostic; diff --git a/src/libsyntax/parse/obsolete.rs b/src/libsyntax/parse/obsolete.rs index 1b2ab3c235d..e2dee607c69 100644 --- a/src/libsyntax/parse/obsolete.rs +++ b/src/libsyntax/parse/obsolete.rs @@ -17,6 +17,8 @@ Obsolete syntax that becomes too hard to parse can be removed. */ +pub use self::ObsoleteSyntax::*; + use ast::{Expr, ExprTup}; use codemap::Span; use parse::parser; diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 50e3483fb15..5c95c369f94 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -10,6 +10,9 @@ #![macro_escape] +pub use self::PathParsingMode::*; +use self::ItemOrViewItem::*; + use abi; use ast::{AssociatedType, BareFnTy, ClosureTy}; use ast::{RegionTyParamBound, TraitTyParamBound}; diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index f501a5831d2..298328d73ef 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -8,6 +8,12 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +pub use self::BinOpToken::*; +pub use self::Nonterminal::*; +pub use self::DelimToken::*; +pub use self::IdentStyle::*; +pub use self::Token::*; + use ast; use ext::mtwt; use ptr::P; @@ -418,6 +424,7 @@ macro_rules! declare_special_idents_and_keywords {( * the language and may not appear as identifiers. */ pub mod keywords { + pub use self::Keyword::*; use ast; pub enum Keyword { -- cgit 1.4.1-3-g733a5