@@ -28,6 +28,7 @@ use middle::cstore;
2828
2929use syntax:: ast:: { self , IntTy , UintTy } ;
3030use syntax:: codemap:: { FileName , FilePathMapping } ;
31+ use syntax:: epoch:: Epoch ;
3132use syntax:: parse:: token;
3233use syntax:: parse;
3334use syntax:: symbol:: Symbol ;
@@ -111,59 +112,6 @@ pub enum OutputType {
111112 DepInfo ,
112113}
113114
114- /// The epoch of the compiler (RFC 2052)
115- #[ derive( Clone , Copy , Hash , PartialOrd , Ord , Eq , PartialEq , Debug ) ]
116- #[ non_exhaustive]
117- pub enum Epoch {
118- // epochs must be kept in order, newest to oldest
119- /// The 2015 epoch
120- Epoch2015 ,
121- /// The 2018 epoch
122- Epoch2018 ,
123- // when adding new epochs, be sure to update:
124- //
125- // - the list in the `parse_epoch` static
126- // - the match in the `parse_epoch` function
127- // - add a `rust_####()` function to the session
128- // - update the enum in Cargo's sources as well
129- //
130- // When -Zepoch becomes --epoch, there will
131- // also be a check for the epoch being nightly-only
132- // somewhere. That will need to be updated
133- // whenever we're stabilizing/introducing a new epoch
134- // as well as changing the default Cargo template.
135- }
136-
137- pub const ALL_EPOCHS : & [ Epoch ] = & [ Epoch :: Epoch2015 , Epoch :: Epoch2018 ] ;
138-
139- impl ToString for Epoch {
140- fn to_string ( & self ) -> String {
141- match * self {
142- Epoch :: Epoch2015 => "2015" . into ( ) ,
143- Epoch :: Epoch2018 => "2018" . into ( ) ,
144- }
145- }
146- }
147-
148- impl Epoch {
149- pub fn lint_name ( & self ) -> & ' static str {
150- match * self {
151- Epoch :: Epoch2015 => "epoch_2015" ,
152- Epoch :: Epoch2018 => "epoch_2018" ,
153- }
154- }
155- }
156-
157- impl str:: FromStr for Epoch {
158- type Err = ( ) ;
159- fn from_str ( s : & str ) -> Result < Self , ( ) > {
160- match s {
161- "2015" => Ok ( Epoch :: Epoch2015 ) ,
162- "2018" => Ok ( Epoch :: Epoch2018 ) ,
163- _ => Err ( ( ) ) ,
164- }
165- }
166- }
167115
168116impl_stable_hash_for ! ( enum self :: OutputType {
169117 Bitcode ,
@@ -829,9 +777,10 @@ macro_rules! options {
829777
830778 #[ allow( dead_code) ]
831779 mod $mod_set {
832- use super :: { $struct_name, Passes , SomePasses , AllPasses , Sanitizer , Lto , Epoch } ;
780+ use super :: { $struct_name, Passes , SomePasses , AllPasses , Sanitizer , Lto } ;
833781 use rustc_back:: { LinkerFlavor , PanicStrategy , RelroLevel } ;
834782 use std:: path:: PathBuf ;
783+ use syntax:: epoch:: Epoch ;
835784
836785 $(
837786 pub fn $opt( cg: & mut $struct_name, v: Option <& str >) -> bool {
0 commit comments