//! List of the active feature gates.
-use super::{State, Feature};
+use super::{Feature, State};
-use syntax_pos::edition::Edition;
-use syntax_pos::Span;
-use syntax_pos::symbol::{Symbol, sym};
+use rustc_span::edition::Edition;
+use rustc_span::symbol::{sym, Symbol};
+use rustc_span::Span;
macro_rules! set {
($field: ident) => {{
features.$field = true;
}
f as fn(&mut Features, Span)
- }}
+ }};
}
macro_rules! declare_features {
pub fn set(&self, features: &mut Features, span: Span) {
match self.state {
State::Active { set } => set(features, span),
- _ => panic!("called `set` on feature `{}` which is not `active`", self.name)
+ _ => panic!("called `set` on feature `{}` which is not `active`", self.name),
}
}
}
// N.B., `tools/tidy/src/features.rs` parses this information directly out of the
// source, so take care when modifying it.
+#[rustfmt::skip]
declare_features! (
// -------------------------------------------------------------------------
// feature-group-start: internal feature gates
/// Allows using the `unadjusted` ABI; perma-unstable.
(active, abi_unadjusted, "1.16.0", None, None),
- /// Allows identifying crates that contain sanitizer runtimes.
- (active, sanitizer_runtime, "1.17.0", None, None),
-
/// Used to identify crates that contain the profiler runtime.
(active, profiler_runtime, "1.18.0", None, None),
/// Allows the use of `#[cfg(sanitize = "option")]`; set when -Zsanitizer is used.
(active, cfg_sanitize, "1.41.0", Some(39699), None),
+ /// Allows using `..X`, `..=X`, `...X`, and `X..` as a pattern.
+ (active, half_open_range_patterns, "1.41.0", Some(67264), None),
+
/// Allows using `&mut` in constant functions.
(active, const_mut_refs, "1.41.0", Some(57349), None),
/// For example, you can write `x @ Some(y)`.
(active, bindings_after_at, "1.41.0", Some(65490), None),
+ /// Allows `impl const Trait for T` syntax.
+ (active, const_trait_impl, "1.42.0", Some(67792), None),
+
+ /// Allows `T: ?const Trait` syntax in bounds.
+ (active, const_trait_bound_opt_out, "1.42.0", Some(67794), None),
+
// -------------------------------------------------------------------------
// feature-group-end: actual feature gates
// -------------------------------------------------------------------------
sym::or_patterns,
sym::let_chains,
sym::raw_dylib,
+ sym::const_trait_impl,
+ sym::const_trait_bound_opt_out,
];