Skip to content

Commit

Permalink
add a thread_local feature gate
Browse files Browse the repository at this point in the history
  • Loading branch information
thestinger committed Nov 26, 2013
1 parent 2cf3d8a commit a5af479
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/librustc/front/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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.");
}
_ => {}
Expand Down

5 comments on commit a5af479

@bors
Copy link
Contributor

@bors bors commented on a5af479 Nov 26, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on a5af479 Nov 26, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging thestinger/rust/thread_local = a5af479 into auto

@bors
Copy link
Contributor

@bors bors commented on a5af479 Nov 26, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thestinger/rust/thread_local = a5af479 merged ok, testing candidate = 35ebf03

@bors
Copy link
Contributor

@bors bors commented on a5af479 Nov 26, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on a5af479 Nov 26, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 35ebf03

Please sign in to comment.