Skip to content

Commit 60de6b0

Browse files
committed
---
yaml --- r: 59032 b: refs/heads/incoming c: 9042e1e h: refs/heads/master v: v3
1 parent 58a0b8d commit 60de6b0

File tree

17 files changed

+64
-23
lines changed

17 files changed

+64
-23
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: c50a9d5b664478e533ba1d1d353213d70c8ad589
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/incoming: c8e93edf55d3913212922864034fae8443f92f2a
9+
refs/heads/incoming: 9042e1e8de522ffa48ce6a543130bc72ea04d517
1010
refs/heads/dist-snap: 00dbbd01c2aee72982b3e0f9511ae1d4428c3ba9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/libcore/condition.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
use prelude::*;
1414
use task;
15-
use local_data::{local_data_pop, local_data_set};
15+
use task::local_data::{local_data_pop, local_data_set};
1616

1717
// helper for transmutation, shown below.
1818
type RustClosure = (int, int);
@@ -24,14 +24,14 @@ pub struct Handler<T, U> {
2424

2525
pub struct Condition<'self, T, U> {
2626
name: &'static str,
27-
key: local_data::LocalDataKey<'self, Handler<T, U>>
27+
key: task::local_data::LocalDataKey<'self, Handler<T, U>>
2828
}
2929

3030
pub impl<'self, T, U> Condition<'self, T, U> {
3131
fn trap(&'self self, h: &'self fn(T) -> U) -> Trap<'self, T, U> {
3232
unsafe {
3333
let p : *RustClosure = ::cast::transmute(&h);
34-
let prev = local_data::local_data_get(self.key);
34+
let prev = task::local_data::local_data_get(self.key);
3535
let h = @Handler { handle: *p, prev: prev };
3636
Trap { cond: self, handler: h }
3737
}

branches/incoming/src/libcore/core.rc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ pub mod trie;
215215
pub mod task;
216216
pub mod comm;
217217
pub mod pipes;
218-
pub mod local_data;
219218

220219

221220
/* Runtime and platform support */

branches/incoming/src/libcore/os.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,7 @@ fn overridden_arg_key(_v: @OverriddenArgs) {}
12081208
12091209
pub fn args() -> ~[~str] {
12101210
unsafe {
1211-
match local_data::local_data_get(overridden_arg_key) {
1211+
match task::local_data::local_data_get(overridden_arg_key) {
12121212
None => real_args(),
12131213
Some(args) => copy args.val
12141214
}
@@ -1218,7 +1218,7 @@ pub fn args() -> ~[~str] {
12181218
pub fn set_args(new_args: ~[~str]) {
12191219
unsafe {
12201220
let overridden_args = @OverriddenArgs { val: copy new_args };
1221-
local_data::local_data_set(overridden_arg_key, overridden_args);
1221+
task::local_data::local_data_set(overridden_arg_key, overridden_args);
12221222
}
12231223
}
12241224

branches/incoming/src/libcore/prelude.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ pub use io;
8181
pub use iter;
8282
pub use old_iter;
8383
pub use libc;
84-
pub use local_data;
8584
pub use num;
8685
pub use ops;
8786
pub use option;

branches/incoming/src/libcore/rand.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -836,13 +836,13 @@ fn tls_rng_state(_v: @@mut IsaacRng) {}
836836
pub fn task_rng() -> @@mut IsaacRng {
837837
let r : Option<@@mut IsaacRng>;
838838
unsafe {
839-
r = local_data::local_data_get(tls_rng_state);
839+
r = task::local_data::local_data_get(tls_rng_state);
840840
}
841841
match r {
842842
None => {
843843
unsafe {
844844
let rng = @@mut IsaacRng::new_seeded(seed());
845-
local_data::local_data_set(tls_rng_state, rng);
845+
task::local_data::local_data_set(tls_rng_state, rng);
846846
rng
847847
}
848848
}

branches/incoming/src/libcore/rt/local_services.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ mod test {
198198
199199
#[test]
200200
fn tls() {
201-
use local_data::*;
201+
use task::local_data::*;
202202
do run_in_newsched_task() {
203203
unsafe {
204204
fn key(_x: @~str) { }

branches/incoming/src/libcore/task/local_data_priv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use cmp::Eq;
1515
use libc;
1616
use prelude::*;
1717
use task::rt;
18-
use local_data::LocalDataKey;
18+
use task::local_data::LocalDataKey;
1919

2020
use super::rt::rust_task;
2121
use rt::local_services::LocalStorage;

branches/incoming/src/libcore/task/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ use unstable::finally::Finally;
4747
#[cfg(test)] use comm::SharedChan;
4848

4949
mod local_data_priv;
50+
pub mod local_data;
5051
pub mod rt;
5152
pub mod spawn;
5253

branches/incoming/src/librustc/metadata/encoder.rs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,47 @@ fn encode_path(ecx: @EncodeContext,
363363
ebml_w.end_tag();
364364
}
365365

366+
fn encode_reexported_static_method(ecx: @EncodeContext,
367+
ebml_w: &mut writer::Encoder,
368+
exp: &middle::resolve::Export2,
369+
m: @ty::method) {
370+
debug!("(encode static trait method) reexport '%s::%s'",
371+
*exp.name, *ecx.tcx.sess.str_of(m.ident));
372+
ebml_w.start_tag(tag_items_data_item_reexport);
373+
ebml_w.start_tag(tag_items_data_item_reexport_def_id);
374+
ebml_w.wr_str(def_to_str(m.def_id));
375+
ebml_w.end_tag();
376+
ebml_w.start_tag(tag_items_data_item_reexport_name);
377+
ebml_w.wr_str(*exp.name + "::" + *ecx.tcx.sess.str_of(m.ident));
378+
ebml_w.end_tag();
379+
ebml_w.end_tag();
380+
}
381+
382+
fn encode_reexported_static_methods(ecx: @EncodeContext,
383+
ebml_w: &mut writer::Encoder,
384+
mod_path: &[ast_map::path_elt],
385+
exp: &middle::resolve::Export2) {
386+
match ecx.tcx.trait_methods_cache.find(&exp.def_id) {
387+
Some(methods) => {
388+
match ecx.tcx.items.find(&exp.def_id.node) {
389+
Some(&ast_map::node_item(_, path)) => {
390+
if mod_path != *path {
391+
for methods.each |&m| {
392+
if m.self_ty == ast::sty_static {
393+
encode_reexported_static_method(ecx,
394+
ebml_w,
395+
exp, m);
396+
}
397+
}
398+
}
399+
}
400+
_ => {}
401+
}
402+
}
403+
_ => {}
404+
}
405+
}
406+
366407
fn encode_info_for_mod(ecx: @EncodeContext,
367408
ebml_w: &mut writer::Encoder,
368409
md: &_mod,
@@ -413,6 +454,7 @@ fn encode_info_for_mod(ecx: @EncodeContext,
413454
ebml_w.wr_str(*exp.name);
414455
ebml_w.end_tag();
415456
ebml_w.end_tag();
457+
encode_reexported_static_methods(ecx, ebml_w, path, exp);
416458
}
417459
}
418460
None => {

branches/incoming/src/librustdoc/extract.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use astsrv;
1414
use doc::ItemUtils;
1515
use doc;
1616

17-
use core::local_data::local_data_get;
17+
use core::task::local_data::local_data_get;
1818
use syntax::ast;
1919
use syntax;
2020

branches/incoming/src/libstd/rl.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ fn complete_key(_v: @CompletionCb) {}
6969

7070
/// Bind to the main completion callback
7171
pub unsafe fn complete(cb: CompletionCb) {
72-
local_data::local_data_set(complete_key, @(cb));
72+
task::local_data::local_data_set(complete_key, @(cb));
7373

7474
extern fn callback(line: *c_char, completions: *()) {
7575
unsafe {
76-
let cb = *local_data::local_data_get(complete_key)
76+
let cb = *task::local_data::local_data_get(complete_key)
7777
.get();
7878

7979
do cb(str::raw::from_c_str(line)) |suggestion| {

branches/incoming/src/libstd/sort.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,11 +1211,11 @@ mod big_tests {
12111211
#[unsafe_destructor]
12121212
impl<'self> Drop for LVal<'self> {
12131213
fn finalize(&self) {
1214-
let x = unsafe { local_data::local_data_get(self.key) };
1214+
let x = unsafe { task::local_data::local_data_get(self.key) };
12151215
match x {
12161216
Some(@y) => {
12171217
unsafe {
1218-
local_data::local_data_set(self.key, @(y+1));
1218+
task::local_data::local_data_set(self.key, @(y+1));
12191219
}
12201220
}
12211221
_ => fail!(~"Expected key to work"),

branches/incoming/src/libstd/sort_stage0.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,11 +1202,11 @@ mod big_tests {
12021202
#[unsafe_destructor]
12031203
impl<'self> Drop for LVal<'self> {
12041204
fn finalize(&self) {
1205-
let x = unsafe { local_data::local_data_get(self.key) };
1205+
let x = unsafe { task::local_data::local_data_get(self.key) };
12061206
match x {
12071207
Some(@y) => {
12081208
unsafe {
1209-
local_data::local_data_set(self.key, @(y+1));
1209+
task::local_data::local_data_set(self.key, @(y+1));
12101210
}
12111211
}
12121212
_ => fail!(~"Expected key to work"),

branches/incoming/src/libsyntax/ast.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl<S:Encoder> Encodable<S> for ident {
7474
fn encode(&self, s: &mut S) {
7575
unsafe {
7676
let intr =
77-
match local_data::local_data_get(interner_key!()) {
77+
match task::local_data::local_data_get(interner_key!()) {
7878
None => fail!(~"encode: TLS interner not set up"),
7979
Some(intr) => intr
8080
};
@@ -87,7 +87,7 @@ impl<S:Encoder> Encodable<S> for ident {
8787
impl<D:Decoder> Decodable<D> for ident {
8888
fn decode(d: &mut D) -> ident {
8989
let intr = match unsafe {
90-
local_data::local_data_get(interner_key!())
90+
task::local_data::local_data_get(interner_key!())
9191
} {
9292
None => fail!(~"decode: TLS interner not set up"),
9393
Some(intr) => intr

branches/incoming/src/libsyntax/parse/token.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ pub fn mk_fresh_ident_interner() -> @ident_interner {
462462
interner: interner::Interner::prefill(init_vec)
463463
};
464464
unsafe {
465-
local_data::local_data_set(interner_key!(), @rv);
465+
task::local_data::local_data_set(interner_key!(), @rv);
466466
}
467467
rv
468468
}
@@ -471,7 +471,7 @@ pub fn mk_fresh_ident_interner() -> @ident_interner {
471471
// fresh one.
472472
pub fn mk_ident_interner() -> @ident_interner {
473473
unsafe {
474-
match local_data::local_data_get(interner_key!()) {
474+
match task::local_data::local_data_get(interner_key!()) {
475475
Some(interner) => *interner,
476476
None => {
477477
mk_fresh_ident_interner()

0 commit comments

Comments
 (0)