use abi::Abi;
use ast::{self, NodeId, PatKind, RangeEnd};
use attr;
-use epoch::Epoch;
+use edition::Edition;
use codemap::Spanned;
use syntax_pos::{Span, DUMMY_SP};
use errors::{DiagnosticBuilder, Handler, FatalError};
}
macro_rules! declare_features {
- ($((active, $feature: ident, $ver: expr, $issue: expr, $epoch: expr),)+) => {
+ ($((active, $feature: ident, $ver: expr, $issue: expr, $edition: expr),)+) => {
/// Represents active features that are currently being implemented or
/// currently being considered for addition/removal.
const ACTIVE_FEATURES:
&'static [(&'static str, &'static str, Option<u32>,
- Option<Epoch>, fn(&mut Features, Span))] =
- &[$((stringify!($feature), $ver, $issue, $epoch, set!($feature))),+];
+ Option<Edition>, fn(&mut Features, Span))] =
+ &[$((stringify!($feature), $ver, $issue, $edition, set!($feature))),+];
/// A set of features to be used by later passes.
#[derive(Clone)]
(active, match_default_bindings, "1.22.0", Some(42640), None),
// Trait object syntax with `dyn` prefix
- (active, dyn_trait, "1.22.0", Some(44662), Some(Epoch::Epoch2018)),
+ (active, dyn_trait, "1.22.0", Some(44662), Some(Edition::Edition2018)),
// `crate` as visibility modifier, synonymous to `pub(crate)`
(active, crate_visibility_modifier, "1.23.0", Some(45388), None),
}
pub fn get_features(span_handler: &Handler, krate_attrs: &[ast::Attribute],
- epoch: Epoch) -> Features {
+ edition: Edition) -> Features {
let mut features = Features::new();
let mut feature_checker = FeatureChecker::default();
- for &(.., f_epoch, set) in ACTIVE_FEATURES.iter() {
- if let Some(f_epoch) = f_epoch {
- if epoch >= f_epoch {
+ for &(.., f_edition, set) in ACTIVE_FEATURES.iter() {
+ if let Some(f_edition) = f_edition {
+ if edition >= f_edition {
// FIXME(Manishearth) there is currently no way to set
- // lang features by epoch
+ // lang features by edition
set(&mut features, DUMMY_SP);
}
}