Skip to content

Commit a5af479

Browse files
committed
add a thread_local feature gate
1 parent 2cf3d8a commit a5af479

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

Diff for: src/librustc/front/feature_gate.rs

+14-2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
3838
("asm", Active),
3939
("managed_boxes", Active),
4040
("non_ascii_idents", Active),
41+
("thread_local", Active),
4142

4243
// These are used to test this portion of the compiler, they don't actually
4344
// mean anything
@@ -107,6 +108,17 @@ impl Visitor<()> for Context {
107108
}
108109

109110
fn visit_item(&mut self, i: @ast::item, _:()) {
111+
// NOTE: uncomment after snapshot
112+
/*
113+
for attr in i.attrs.iter() {
114+
if "thread_local" == attr.name() {
115+
self.gate_feature("thread_local", i.span,
116+
"`#[thread_local]` is an experimental feature, and does not \
117+
currently handle destructors. There is no corresponding \
118+
`#[task_local]` mapping to the task model");
119+
}
120+
}
121+
*/
110122
match i.node {
111123
ast::item_enum(ref def, _) => {
112124
for variant in def.variants.iter() {
@@ -152,8 +164,8 @@ impl Visitor<()> for Context {
152164
},
153165
ast::ty_box(_) => {
154166
self.gate_feature("managed_boxes", t.span,
155-
"The managed box syntax is being replaced by the `std::gc::Gc`
156-
and `std::rc::Rc` types. Equivalent functionality to managed
167+
"The managed box syntax is being replaced by the `std::gc::Gc` \
168+
and `std::rc::Rc` types. Equivalent functionality to managed \
157169
trait objects will be implemented but is currently missing.");
158170
}
159171
_ => {}

0 commit comments

Comments
 (0)