summary refs log tree commit diff
path: root/src/libsyntax/feature_gate
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-08-22 23:49:55 +0200
committerMazdak Farrokhzad <twingoow@gmail.com>2019-08-23 01:41:54 +0200
commit6febb75ec8e0aeade9be97a1224bd6327b531524 (patch)
treeaa013282fa10169de3f183fad7e6b5ffc860591c /src/libsyntax/feature_gate
parent87eafd6c1b844f4258a2bbd7563c16609c4606e6 (diff)
downloadrust-6febb75ec8e0aeade9be97a1224bd6327b531524.tar.gz
rust-6febb75ec8e0aeade9be97a1224bd6327b531524.zip
syntax: move `feature_gate.rs`.
Diffstat (limited to 'src/libsyntax/feature_gate')
-rw-r--r--src/libsyntax/feature_gate/mod.rs31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/libsyntax/feature_gate/mod.rs b/src/libsyntax/feature_gate/mod.rs
new file mode 100644
index 00000000000..97793bca1f5
--- /dev/null
+++ b/src/libsyntax/feature_gate/mod.rs
@@ -0,0 +1,31 @@
+//! # Feature gating
+//!
+//! This module implements the gating necessary for preventing certain compiler
+//! features from being used by default. This module will crawl a pre-expanded
+//! AST to ensure that there are no features which are used that are not
+//! enabled.
+//!
+//! Features are enabled in programs via the crate-level attributes of
+//! `#![feature(...)]` with a comma-separated list of features.
+//!
+//! For the purpose of future feature-tracking, once code for detection of feature
+//! gate usage is added, *do not remove it again* even once the feature
+//! becomes stable.
+
+mod accepted;
+mod removed;
+mod active;
+mod builtin_attrs;
+mod check;
+
+pub use active::{Features, INCOMPLETE_FEATURES};
+pub use builtin_attrs::{
+    AttributeGate, AttributeType, GatedCfg,
+    BuiltinAttribute, BUILTIN_ATTRIBUTES, BUILTIN_ATTRIBUTE_MAP,
+    deprecated_attributes, is_builtin_attr,  is_builtin_attr_name,
+};
+pub use check::{
+    check_attribute, check_crate, get_features, feature_err, emit_feature_err,
+    Stability, GateIssue, UnstableFeatures,
+    EXPLAIN_STMT_ATTR_SYNTAX, EXPLAIN_UNSIZED_TUPLE_COERCION,
+};