summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2013-11-26 14:21:22 -0500
committerDaniel Micay <danielmicay@gmail.com>2013-11-26 14:49:14 -0500
commita5af479bb479a2a4d3289f9feed9ac3ff299a395 (patch)
tree247a71d3c138db8e864d204230e54ba822fb5bd8 /src
parent2cf3d8adf2cbdf760063a247162a558e68fe35fd (diff)
downloadrust-a5af479bb479a2a4d3289f9feed9ac3ff299a395.tar.gz
rust-a5af479bb479a2a4d3289f9feed9ac3ff299a395.zip
add a thread_local feature gate
Diffstat (limited to 'src')
-rw-r--r--src/librustc/front/feature_gate.rs16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/librustc/front/feature_gate.rs b/src/librustc/front/feature_gate.rs
index 6103312bc78..be35a309c44 100644
--- a/src/librustc/front/feature_gate.rs
+++ b/src/librustc/front/feature_gate.rs
@@ -38,6 +38,7 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
     ("asm", Active),
     ("managed_boxes", Active),
     ("non_ascii_idents", Active),
+    ("thread_local", Active),
 
     // These are used to test this portion of the compiler, they don't actually
     // mean anything
@@ -107,6 +108,17 @@ impl Visitor<()> for Context {
     }
 
     fn visit_item(&mut self, i: @ast::item, _:()) {
+        // NOTE: uncomment after snapshot
+        /*
+        for attr in i.attrs.iter() {
+            if "thread_local" == attr.name() {
+                self.gate_feature("thread_local", i.span,
+                                  "`#[thread_local]` is an experimental feature, and does not \
+                                  currently handle destructors. There is no corresponding \
+                                  `#[task_local]` mapping to the task model");
+            }
+        }
+        */
         match i.node {
             ast::item_enum(ref def, _) => {
                 for variant in def.variants.iter() {
@@ -152,8 +164,8 @@ impl Visitor<()> for Context {
             },
             ast::ty_box(_) => {
                 self.gate_feature("managed_boxes", t.span,
-                                  "The managed box syntax is being replaced by the `std::gc::Gc`
-                                  and `std::rc::Rc` types. Equivalent functionality to managed
+                                  "The managed box syntax is being replaced by the `std::gc::Gc` \
+                                  and `std::rc::Rc` types. Equivalent functionality to managed \
                                   trait objects will be implemented but is currently missing.");
             }
             _ => {}